0
How do you use if else statements with input()??
I am playing around, trying to figure out certain things, and I am creating a conversation thread with my code where it takes user input, such as "hello, what is your name?" user inputs name, then code responds, repeating the users inputed name
3 odpowiedzi
+ 1
# You should store the input in a variable.
user_name = input("Enter your name: ")
if (user_name == "Andrew"):
print("Admin: Hello Andrew! How are you?")
else:
print("Admin: Sorry, " + user_name + "! I don't know you.")
0
please share your code
- 1
Edit tags to specify language you are using.