Why isnt this working? Pls help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
31st Aug 2017, 11:59 PM
Eric Durney
Eric Durney - avatar
7 Answers
+ 1
use this: print ("wot 1+1") (x)=input("answer here:") if x != "2": print ("wrong") else: print ("well done") errors: there was no colon after if and else. there was unnecessary indention for else x can't have quotations use != instead of not
1st Sep 2017, 12:08 AM
HJ🐓TDM
+ 9
lol.. paul.. but 1+1 is 2.. 😊 and need to convert input to int int(x) as input is string
1st Sep 2017, 12:12 AM
jay
jay - avatar
+ 1
thanks for the help I really appreciate it
1st Sep 2017, 12:10 AM
Eric Durney
Eric Durney - avatar
+ 1
@Paul it should be !=
1st Sep 2017, 12:12 AM
HJ🐓TDM
+ 1
!= means not equal if 1+1 is not 2 then its wrong if it is well done if yours works then I don't know
1st Sep 2017, 12:14 AM
HJ🐓TDM