+ 1
How do you test if your input number+10=19?
I tried: input () if (input)+10=19:print('Yes!') else:print('nope') but I still get a SyntaxError. And I still inputed the 9
2 Answers
+ 2
if int(input())+10==19:print("Yes!")
else:print("nope")
#this is the correct code
+ 2
1. input is a function. If you wanna store the value, store it under a separate variable name.
2. = is the assignment operator in Pythpn, not an equality checker. The rquality checker is ==
3.input() returns a string, not an integer. If you want an integer, you must convert it to one.