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())
你的循環內部哪裏是停止*改變*? –
stops是一個'int()',你爲什麼要把它與'「x」'比較? –
另外,你有**兩個''while''循環,移除外層,它沒有任何用處。當您將其轉換爲「int」時,'stops'永遠不會等於一個字符串。 –