Hi, back again for Python Idle. I am trying to figure out if there is a way to make Python Idle show the response to the user's input before asking the next question.
Explain more.
I want to create a program that asks the user a question like" What is your favorite class?" and then show the response of" I like that too." but instead of showing the coded response, the next input box comes up. the response to the users input only appears after there are no more input commands.
\(\color{#0cbb34}{\text{Originally Posted by}}\) @Aqual I want to create a program that asks the user a question like" What is your favorite class?" and then show the response of" I like that too." \(\color{#0cbb34}{\text{End of Quote}}\) You can use a print statement for that. This is what you can use to output that message. print("I like that class too.") This allows the program to give an automated response in place of having to input a message yourself.
And if you are worried about the response being delayed until the very end of the program, then you have to place the print statement in between the lines of code. For instance: color = input("What is your favorite color?") print("I love that color as well!") grade = input("What grade are you in?") print("I'm in the same grade as you!") You cannot put each print statements at the end if you want the response to show up in between the "conversation".
In that specific block of code, the program will respond to the user's inputs as appropriately while not also being put off until after the program has finished execution.
But like I said, I would probably use repl.it for your coding. It's free to use anytime, no downloads required.
ok, im lookin at it.
thank you
it works thanks
No problem
Join our real-time social learning platform and learn together with your friends!