Why it doesnt functions!?!? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 Answers
+ 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