#------------------------------------------------------------ # Name: Input Validation # Purpose: Checking Input Validity # # Author: KQ # # Created: 17/03/25 # Copyright: (c) KQ 2025 # Licence: #------------------------------------------------------------ # Checking for name validation. Will only accept names with no numbers or spaces. while true: name = str(input"What is your name? ")) if name.isalpha() == True: break else: print("That is not an acceptable name please try again") # Checking for integer input validation. while True: try: rounds = int(input("How many rounds do you want to play? 1-5")) if rounds < 1 or rounds > 5: #if the user inputs a number above 5 or belove 0, it asks again print("Please select a number between 1 and 5") else: break except: #If the user doesn't input a number at all, it ask again print ("Please select a number between 1 and 5")