Maybe try something like
#! /usr/bin/env python3 def play(): while True: play_again = input('Play Again? ') if play_again.lower() in ['y', 'yes']: print('I am playing agin') # Do some stuff elif play_again.lower() in ['n', 'no']: print('Thanks for playing!') break else: print('Please type yes or no') continue play()
Output:Play Again? yes
I am playing agin
Play Again? mm
Please type yes or no
Play Again? no
Thanks for playing!
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags