+ 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
5 Réponses
+ 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.
+ 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?
+ 2
I don't write the code on Solo learn.
I write the code using Python idle and V.S code editor
+ 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.
+ 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