0

can anyone hell me?

x = Input("Hey ") if x = hi: print ("ok") else: print ("no")

9th Oct 2016, 2:05 PM
Darcie
Darcie - avatar
3 Respuestas
+ 3
Fix your errors: >>> x = Input("Hey ") NameError: name 'Input' is not defined Python thinks Input is a function you've defined. You probably mean 'input'. >>> if x = hi: if x = hi: ^ SyntaxError: invalid syntax You're assigning the value in the variable 'hi' to the variable 'x' and then checking if the assignment was successful. You probably mean to check for equivalence (==) against a "string".
9th Oct 2016, 5:46 PM
Kirk Schafer
Kirk Schafer - avatar
0
if x == "hi":
10th Oct 2016, 1:27 PM
Fhatuwani Luvhengo
Fhatuwani Luvhengo - avatar
0
Errors: << x = Input(“Hey “) _______^ Input not defined did you mean input(“Hey “) ? << if x = hi: _______^__^ Did you mean == ? hi is not defined
6th Nov 2018, 4:33 AM
Potato Hacker
Potato Hacker - avatar