Ask coding questions

← Back to all posts
How do I make a selection in python?
MilescOde

So, I'm making a story for a game. I need a choice function for it. It's supposed to be some like an arrow pointing to options. Like

  • option1
  • option2.
    And of course the arrow.
Voters
MilescOde
Comments
hotnewtop
JonDoeBeep

You could probably do something like that with tkinter or pygame. If you are asking like text RPGs then you could definitely do something like:

which would ask the user

Or you could change it to be more like

Or if you want it to be chunkier but less likely to mess up on the user end and throw some weird error like:

Do:

If you prefer that. Hope this could have of helped.
TLDR:
Code above.

MilescOde

@JonDoeBeep Thanks for the idea!

JonDoeBeep
MilescOde

I went for like
def go():
ask = input("...

JonDoeBeep

@MilescOde
Nice game :D