+ 2

How to insert options in input in python

I want to create a code in python which has options of 1, 2 and 3 in input in order to save user's time of writing it. The user would have to select any one of these to proceed. Can you help me with this?

12th Jun 2018, 11:49 AM
Sahil Danayak
Sahil Danayak - avatar
5 Answers
+ 11
You can't do that in code playground đŸ€”
12th Jun 2018, 12:08 PM
Frost
Frost - avatar
+ 13
Do u want to do something like this? def func1(): #something def func2(): #something x = input('Enter a number') if x == 1: func1() elif x == 2: func2() We could help better if you can show your code or what you have tried..
12th Jun 2018, 11:53 AM
Frost
Frost - avatar
+ 6
the only way is x = input("<stuff>") but if you want mcq questions, then go and learn html. you just do <input type= "radio/checkbox"> multiple times
12th Jun 2018, 1:12 PM
DengSXCreates
DengSXCreates - avatar
+ 2
No, when you run the code, and on selecting the input box, you shall have some options like mcq and you have to select one of them btw nice work
12th Jun 2018, 12:03 PM
Sahil Danayak
Sahil Danayak - avatar
+ 2
thanks
12th Jun 2018, 4:10 PM
Sahil Danayak
Sahil Danayak - avatar