2017-08-26 63 views
0

我被困在一段时间真环路,我似乎无法打破,任何建议,请:卡在一段时间真环路,我似乎无法打破

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()) 
+2

你的循环内部哪里是停止*改变*? –

+0

stops是一个'int()',你为什么要把它与'“x”'比较? –

+0

另外,你有**两个''while''循环,移除外层,它没有任何用处。当您将其转换为“int”时,'stops'永远不会等于一个字符串。 –

回答

0

你需要拍X = ='x'打破第一个while循环,同时给int一个中断第二个循环。我建议你尽量不要使用stop和int。

+0

哦,我看到我做错了,知道谢谢你 – about30ninjas