Having troubles with input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Having troubles with input

Hi, I'm really new to this whole way of thinking, Im trying to write a code where the user writes his name and the the computer asks the user if he wants to know his name. It looks like this: a=input("Hi, what is you name?\n") print ("oh" ,a, "is a beautiful name") b=input('Wanna know mine?') if b==("yes" or "yea" or "of course"): print("My name is Compi") if b==("no"): print ("ok, fck you then") The first part works fine but when I entre the conditional it starts showing errors. I hope you can help me. Thank you.

3rd Oct 2016, 5:34 PM
Amitai Urbani
Amitai Urbani - avatar
1 Answer
+ 2
b=input('Wanna know mine?') if b==("yes" or "yea" or "of course"): print("My name is Compi") //HERE THE LINE NEED TO BE TABBED :) if b==("no"): print ("ok, fck you then")
3rd Oct 2016, 5:43 PM
Ernesto Salvetti
Ernesto Salvetti - avatar