Sep-22-2024, 03:01 PM
print("Do you like christmas")
likes_christmas = input()
if likes_christmas == "Yes":
likes_christmas = input()
if likes_christmas == "Yes":
|
how can you make a question have more than one awnser
|
|
Sep-22-2024, 03:01 PM
print("Do you like christmas")
likes_christmas = input() if likes_christmas == "Yes":
Sep-22-2024, 03:13 PM
Please use the bbtags when posting code.
You should do a quick search on python basic examples. print('Do you like Christmas?')
question = input('>> ')
if question in ['yes', 'Yes', 'y']:
print(question)
else:
print('ok')
I welcome all feedback.
The only dumb question, is one that doesn't get asked. My Github How to post code using bbtags Download my project scripts
Sep-22-2024, 05:04 PM
Maybe like this:
print("Do you like christmas?")
answers = ['Love it', 'Hate it', 'Don\'t care', 'Sometimes']
print('Possible answers:', answers)
likes_christmas = input('Choose an answer from the above ... ')
while not likes_christmas in answers:
print('Possible answers:', answers)
likes_christmas = input('Choose an answer from the above ... ')PS You need to "escape" the ' in Don't like this: \'
|
|
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| newbie question - can't make code work | tronic72 | 2 | 2,162 |
Oct-22-2023, 09:08 PM Last Post: tronic72 |
|
| so im trying to make a question game for school and im trying to make it when some on | dertder25t | 1 | 2,570 |
Jan-27-2020, 10:44 PM Last Post: woooee |
|