0
i cant find where's the mistake, please help
I want to make a code where if the answer is correct (which is 12 in this case) it should say 'Correct answer' if not then 'Incorrect answer' but i get 'Incorrect answer' both times. Que = input('What is 7+5 =') if Que == 12: print ('Correct answer') else: print ('Incorrect answer')
2 ответов
+ 2
Don't pass anything inside input function.
Also input () function returns String value so you need to make it int by casting with int function.
que = int(input())
+ 2
Naveen just put 12 of if condition in quotations (if Que == "12": )...
Or
Just convert Que to integer by int(Que)