+ 1

How can one make questions on the veiwer with the input function?

I have tried to make a question with a right and wrong answer but what I tried has failed at that goal and ask for advice for the code that goes by the name of "If". This is being worked on with python3.

6th Oct 2019, 12:05 AM
Nikolay Ilyin
Nikolay Ilyin - avatar
2 Réponses
+ 11
Why not post link to the code snippet? By the way if you want an integer value, default value of an input() in python 3 is string. So you might have to convert it to int.
6th Oct 2019, 1:01 AM
BlackRose Mike
BlackRose Mike - avatar
+ 1
you did:- true=20 false=10 inut=input("5 bigger than 20? Is it true or false?") print(inut) if inut==false: print("correct") # should be :- inut=input("5 bigger than 20? Is it true or false?") print(inut) if inut=="false": print("correct")
6th Oct 2019, 12:53 AM
rodwynnejones
rodwynnejones - avatar