0
For Python, how do I respond to an input?
For ex. I say print(input("What\' your name")) and I want to say on a different line, "That's a nice name", how do I do it?
2 Antworten
+ 5
You could possibly make a name variable in which it'll take user input. So something like:
user_name = input("Please enter your name: ")
Then on the next line you could simply use the print function, to display what ever was entered with a comment:
print ("Hey %s, that's a nice name!" % (user_name))
+ 1
First, after making the input method and preferred command, Run it and the will get the command back(usually in question form), simply reply and that's about it...but don is correct