Enough Fuel
Before reaching a gas station, it is useful to know whether the fuel left in the tank is enough. Write a function zero_fuel that takes the distance distance_to_pump, the car’s range in kilometers per litre mpg, and the remaining fuel fuel_left. Return True if the car can reach the pump, otherwise return False.
Примеры
Ввод
50, 25, 2Вывод
TrueВвод
100, 50, 1Вывод
FalseВвод
100, 50, 3Вывод
TrueНужно реализовать
def zero_fuel(distance_to_pump: int, mpg: int, fuel_left: int) -> bool:
Теги
math
Pieslēdzies, lai redzētu iesniegumu vēsturi
PieslēgtiesPieslēdzies, lai izmantotu AI mentoru
PieslēgtiesVisible tests
1
Input
50, 25, 2Expected
True2
Input
100, 50, 1Expected
False3
Input
100, 50, 3Expected
True4
Input
20, 5, 3Expected
False5
Input
0, 1, 0Expected
True6
Input
0, 1, -1Expected
FalseFocus radio
Paused · SomaFM · Fluid