Input in else statements | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Input in else statements

Can you use input in any else statement Because it does not work for me

29th Jan 2019, 1:08 AM
Ryan John Colley
8 Answers
+ 4
Using this code, it works fine for me: if 5*8 == 55: print (55) else: print(input("your age:"))
29th Jan 2019, 2:21 AM
Rowsej
Rowsej - avatar
+ 2
Can you please show your code?
29th Jan 2019, 1:40 AM
Rowsej
Rowsej - avatar
+ 2
You need to put your age: in quotation marks, like this: print(input("your age:"))
29th Jan 2019, 1:44 AM
Rowsej
Rowsej - avatar
+ 1
ok
29th Jan 2019, 1:40 AM
Ryan John Colley
+ 1
if 5*8 == 55: print (55) else: print(input(your age:))
29th Jan 2019, 1:42 AM
Ryan John Colley
+ 1
ok thx
29th Jan 2019, 1:44 AM
Ryan John Colley
+ 1
ir still says there is an error
29th Jan 2019, 1:46 AM
Ryan John Colley
+ 1
thx
29th Jan 2019, 2:21 AM
Ryan John Colley