+ 1

How to Execute sequence wise in step argument

I write a code in Python and use step argument in it but place holder is executing first although I write it after the message. If I want of show the code first then wants to execute whatever in the placeholder Then how can I do this 👆☝ I gave my code below https://code.sololearn.com/c6Wnn0AoxzqV/?ref=app

27th Nov 2018, 12:15 PM
chandrapal singh
chandrapal singh - avatar
5 Respuestas
+ 1
Okay, for that, you could use two separate print statements, like print("Reverse of your name is,") print(f"{input('enter your name :')[::-1]} ") Or, if you want the output in the same line, you could do print("Reverse of your name is", end=" ") print(f"{input('enter your name :')[::-1]} ") Does that help? Please let me know.
27th Nov 2018, 1:42 PM
Kishalaya Saha
Kishalaya Saha - avatar
+ 3
On Sololearn's Python, all the inputs are taken first, and then the code is executed on Sololearn's server. So there's no way to display the input prompt before the user actually enters the input. But in a regular offline interpreter (like, if you have Python installed in your computer), it wouldn't be a problem. On Sololearn I usually just use input() without any prompt message, as it doesn't matter anyway. Does that answer your question?
27th Nov 2018, 12:29 PM
Kishalaya Saha
Kishalaya Saha - avatar
+ 2
I don't write the code on Solo learn. I write the code using Python idle and V.S code editor
27th Nov 2018, 12:59 PM
chandrapal singh
chandrapal singh - avatar
+ 1
So in Python IDE, could you please write down how you want the input/output sequence to look like? I don't think I understood your question.
27th Nov 2018, 1:25 PM
Kishalaya Saha
Kishalaya Saha - avatar
+ 1
Reverse of your name is {*Here asking for input *}(Enter your name) - Sololearn {*Then output is*} - nraelolos Text in {*_* } is not included in output
27th Nov 2018, 1:35 PM
chandrapal singh
chandrapal singh - avatar