I've just started learning python a month ago and I've been wanting to create a choose your story prompt as one.
It looks like this
while True:
try:
party = int(input("How many people joined the party "))
except ValueError:
print("Sorry, I didn't understand that.")
continue
A few things I noticed and don't know how to fix is this
- I can't set a maximum number of people to join the party and without that, it loops constantly with message input no matter what.
- I can't stop a negative input
- I can't enter a "Please enter a number below that" Sorry if this is dumb, I just came to a website that usually fixed my issues in python and couldn't find something that fixed my issues exactly.