+ 1
What is wrong in my code?
8 Réponses
+ 6
put quotes for who are you like (if you're comparing for string)
"who are you"
Harun Yavuz yours break statement is also not in a very promising place.
+ 3
Also asking for user input after break statement doesn't helps and so variable is never declared since break exists the while loop and whatever put after that isn't read
+ 2
print("Hello. My name is Teressa. I am your assistant. How may I help you?")
user_input = input()
if (user_input == "who are you"):
print("My name is Teressa.")
Try this 🙂
https://code.sololearn.com/clNB166T9293/?ref=app
+ 2
Harun Yavuz
You never declared the user_input variable.
In line 2 replace '==' with '='.
These have different meanings.
'==' is for comparison and '=' is for variable declaration.
Hope u understood.
Happy coding!
+ 1
Harun Yavuz Can you tell us what do you wanna achieved/make?
0
Now i understand thx <3
0
You put == after user_input when you should only put 1 = to define a variable.
User_input = "who are you" is correct NOT user_input == "who are you "