I am trying to loop a simple exception. I tried to put a while loop, but I keep 
getting syntax issues. I also tried to alternatively use something on the lines 
of "while number != int" also with no avail.   

def main():
    print("\t\tWelcome to Blackjack!\n")
    
    names = []
    try:
        number = games.ask_number("How many players? (1 - 7): ", low = 1, high 
= 8)
    except (ValueError, TypeError):
        print("That is not a number!")
        number = games.ask_number("How many players? (1 - 7): ", low = 1, high 
= 8)
        continue
    for i in range(number):
        name = input("Enter player name: ")
        names.append(name)
    print()
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to