2014-03-02 26 views

回答

6

,当你有你的输入使用一个无限循环和break出来:

while True: 
    players = input("How many players?") 
    if players == "1": 
     p1 += 1 
     break 
    elif players == "2": 
     p2 += 1 
     break 
    else: 
     print("Sorry, please pick 1 or 2. Let's try again") 
相关问题