0
can anyone hell me?
x = Input("Hey ") if x = hi: print ("ok") else: print ("no")
3 Respostas
+ 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".
0
if x == "hi":
0
Errors:
<< x = Input(“Hey “)
_______^
Input not defined
did you mean input(“Hey “) ?
<< if x = hi:
_______^__^
Did you mean == ?
hi is not defined