Не могу понять, почему этот дозорный не будет работать. Я искал повсюду ответ, но безрезультатно. Спасибо за помощь!
gas = 0
miles = 0
miles = int(input("Enter number of miles driven(enter -11 to exit): "))
while miles != -11:
gas = int(input("Enter the number of gallons of gas used: "))
print ("The number of miles entered was:", miles)
print ("The number of gallons of gas used was:", gas)
mpg = miles/gas
print ("The MPG was:", mpg)
Вот результат:
Enter number of miles driven(enter -11 to exit): 100
Enter the number of gallons of gas used: 10
The number of miles entered was: 100
The number of gallons of gas used was: 10
The MPG was: 10.0
Enter the number of gallons of gas used: -11
The number of miles entered was: 100
The number of gallons of gas used was: -11
The MPG was: -9.090909090909092
Enter the number of gallons of gas used:
Подробнее здесь: https://stackoverflow.com/questions/224 ... ot-working