我试图阻止用户输入超过玩家池的团队成员数量。
while True:
try:
numMembers = int(input("How many students per team (2, or 3) "))
if numMembers > totalStudents:
errorHand = 1/0
except:
print("Too many members per team, please try again")
continue
else:
break
只是想避免我想出的 hackity div/0 技巧。
扬帆大鱼
相关分类