Ask coding questions

← Back to all posts
how to make a multi choice game
Sammu8302

so I was trying to make a simulator game with python and a needed a way to have 4 options to chose like
What is 5 + 4
A:9
B:6
C:1
D:54
Awnswer: A
that is correct.
so how to I do that.

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
fluffyfluffybun
Sammu8302
Comments
hotnewtop
Coder100

You can use if statements and inputs:

that's the easiest way to do it, you can't really restrict user input per say, and you shouldn't need to.

Sammu8302

@Coder100 you came in to save the day!

Coder100

yay np

mark as correct answer? @Sammu8302

Sammu8302

@Coder100 actually if I use this it keeps saying error expected a intended block

Coder100

right don't forget to add the code @Sammu8302

Sammu8302

Ok so remember I am trying to make a simulator not a quiz.

fluffyfluffybun

print("Whats 5+4?\nA:9\nB:6\nC:1\nD:54")
if input() == "A":
print("good job!")
else:
print("nope!")

That should work.

MrVoo

Use if statements and inputs

Sammu8302

@MrVoo wait what(sorry I just started python)

MrVoo

@Sammu8302 You should learn the basics before you make something :P

Sammu8302

@MrVoo I do know some of it, it is not like I stared today.