2014-03-02 68 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") 
相關問題