+ 1

Why it doesnt functions!?!?

x = (input("Enter something: ")) if x = ("Hi") : print("Helo") else: print("Nope")

26th Sep 2018, 10:58 AM
Joe
Joe - avatar
3 Antworten
+ 7
if x == "Hi": You used the assignment operator instead of the comparison.
26th Sep 2018, 11:10 AM
Izaak GOLDSTEIN
Izaak GOLDSTEIN - avatar
26th Sep 2018, 11:18 AM
Izaak GOLDSTEIN
Izaak GOLDSTEIN - avatar
+ 2
thnx
26th Sep 2018, 11:12 AM
Joe
Joe - avatar