我陷入了一个我似乎无法打破的真实循环,有什么建议吗
minstops = 1
maxstops = 100
minpass = 0
maxpass = 35
print ("Please enter the route number")
route = input()
print("Please enter number of stops on" , route,".")
stops = int(input())
while stops != "x":
while True:
if stops >= minstops and stops <= maxstops:
break
else:
print ("Please enter a number between",minstops,"and",maxstops,".")
print ("Please enter the number of people already on",route,".")
numofpassonbus = int(input())
你需要一个x=='x'来打断第一个while循环,而你需要一个int来打断第二个while循环。我建议你尽量不要把stops用作int和string
相关问题 更多 >
编程相关推荐