Will you make it?

You were camping with your friends far away from home, but when it's time to go back, you realize that your fuel is running out and the nearest pump is ```50``` miles away! You know that on average, your car runs on about ```25``` miles per gallon. There are ```2``` gallons left. Considering these factors, write a function that tells you if it is possible to get to the pump or not. Function should return ``true`` (`1` in Prolog) if it is possible and ``false`` (`0` in Prolog) if not.
The input values are always positive.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Mathematics

Starter code: def zero_fuel(distance_to_pump, mpg, fuel_left):
	

Solutions:
def zero_fuel(distance_to_pump, mpg, fuel_left):
	if fuel_left >= distance_to_pump / mpg:
		print('We got to the pump')
		return True
	else:
		print('We pushed the car to the pump(((')
		return False
print(zero_fuel(50, 25, 2))


def zero_fuel(distance_to_pump, mpg, fuel_left):
	return mpg * fuel_left >= distance_to_pump


zero_fuel = lambda d, m, f: d <= m * f


zero_fuel = lambda _, __, ___: ___ * __ >= _


def zero_fuel(distance_to_pump, mpg, fuel_left):
	res = mpg * fuel_left
	if distance_to_pump <= res:
		return 1
	else:
		return 0


def zero_fuel(dtp, mpg, fuel_left):
	return mpg * fuel_left >= dtp


def zero_fuel(a, b, c):
	return a <= b * c


def zero_fuel(distance_to_pump, mpg, fuel_left):
	if mpg * fuel_left >= distance_to_pump:
		return True
	else:
		return False


zero_fuel = lambda *arg: arg[0] <= arg[1] * arg[2]


def zero_fuel(distance_to_pump, mpg, fuel_left):
	result = mpg * fuel_left
	if distance_to_pump <= result:
		return True
	else:
		return False
zero_fuel(100, 50, 3)


zero_fuel = lambda distance_to_pump, mpg, fuel_left: mpg * fuel_left >= distance_to_pump


def zero_fuel(distance_to_pump, mpg, fuel_left):
	total = mpg * fuel_left
	if distance_to_pump <= total:
		return True
	return False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	a = mpg * fuel_left
	if a >= distance_to_pump:
		return True
	elif a <= distance_to_pump:
		return False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	if distance_to_pump / (mpg * fuel_left) <= 1:
		x = True
		return bool(x)
	else:
		x = False
		return bool(x)


def zero_fuel(distance_to_pump, mpg, fuel_left):
	a = distance_to_pump * (1 / mpg) - fuel_left
	if a <= 0:
		return True
	else:
		return False


def zero_fuel(mile, fuel, gallon):
	return fuel * gallon >= mile


def zero_fuel(dtp, mpg, fl):
	return not dtp > mpg * fl


def zero_fuel(d, m, f):
	if d > m * f:
		return False
	return True


def zero_fuel(distance_to_pump, mpg, fuel_left):
	if distance_to_pump - mpg * fuel_left > 0:
		return False
	return True


def zero_fuel(d, m, f):
	c = d / m
	if c <= f:
		return True
	else:
		return False


zero_fuel = lambda a, b, c: a <= b * c


def zero_fuel(distance_to_pump, mpg, fuel_left):
	longest_distance = mpg * fuel_left
	if distance_to_pump <= longest_distance:
		return True
	return False


zero_fuel = lambda d, m, f: True if m * f >= d else False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	distance_to_pump = int(distance_to_pump)
	mpg = float(mpg)
	fuel_left = float(fuel_left)
	while distance_to_pump > mpg * fuel_left:
		return False
	else:
		return True


def zero_fuel(distance_to_pump, mpg, fuel_left):
	nth = distance_to_pump / mpg
	nth2 = fuel_left - nth
	if nth2 >= 0:
		return True
	else:
		return False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	fuel_necessary = distance_to_pump / mpg
	if fuel_left >= fuel_necessary:
		return True
	if fuel_left < fuel_necessary:
		return False


def zero_fuel(d, m, f):
	a = m * f
	if a >= d:
		return True
	else:
		return False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	distance_to_pump = int(distance_to_pump)
	mpg = int(mpg)
	fuel_left = int(fuel_left)
	result = False
	if fuel_left * mpg >= distance_to_pump:
		result = True
	return result


def zero_fuel(distance_to_pump, mpg, fuel_left):
	if distance_to_pump == mpg * fuel_left or distance_to_pump < mpg * fuel_left:
		return True
	if distance_to_pump > mpg * fuel_left:
		return False


zero_fuel = lambda x, y, z: z * y >= x


def zero_fuel(distance_to_pump, mpg, fuel_left):
	print(distance_to_pump, mpg, fuel_left)
	return True if distance_to_pump - mpg * fuel_left <= 0 else False


def zero_fuel(d, mpg, fl):
	if fl * mpg >= d:
		return True
	else:
		return False


def zero_fuel(d, a, g):
	return True if a * g >= d else False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	if fuel_left == 0:
		return distance_to_pump <= mpg
	elif fuel_left > 0:
		m = mpg * fuel_left
	return distance_to_pump <= m


def zero_fuel(dist, mpg, fuel):
	return bool(dist <= mpg * fuel)


def zero_fuel(distance_to_pump, mpg, gallon_left):
	if mpg * gallon_left >= distance_to_pump:
		return True
	else:
		return False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	if distance_to_pump / mpg - fuel_left <= 0:
		ergebnis = True
	else:
		ergebnis = False
	return ergebnis
print(zero_fuel(50, 25, 2))
print(zero_fuel(100, 50, 1))


def zero_fuel(dpump, mpg, fuel):
	if mpg * fuel >= dpump:
		return True
	else:
		return False


def zero_fuel(dis, mpg, fu):
	return dis / mpg <= fu


def zero_fuel(distance, mpg, gallons):
	bool = False
	mpg = mpg * gallons
	if mpg >= distance:
		bool = True
	return bool


def zero_fuel(distance_to_pump: float, mpg: float, fuel_left: float) -> bool:
	gallons_needed = distance_to_gallons(distance_to_pump, mpg)
	rslt = gallons_needed <= fuel_left
	return rslt

def distance_to_gallons(distance_to_pump: float, mpg: float) -> float:
	if mpg == 0:
		return 0
	return distance_to_pump / mpg


def zero_fuel(pump, miles, gallons):
	return miles * gallons >= pump


def zero_fuel(distance_to_pump, mpg, fuel_left):
	make_it = False
	get_pump = mpg * fuel_left
	if distance_to_pump > get_pump:
		return False
	elif distance_to_pump <= get_pump:
		return True


def zero_fuel(distance_to_pump, mpg, fuel_left):
	if mpg * fuel_left >= distance_to_pump:
		return 1
	elif mpg * fuel_left < distance_to_pump:
		return 0


def zero_fuel(distance, avg, f_l):
	if avg * f_l >= distance:
		return True
	else:
		return False


def zero_fuel(a, b, c):
	if b * c == a or b * c > a:
		return True
	else:
		return False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	result = mpg * fuel_left - distance_to_pump
	return True if result >= 0 else False


def zero_fuel(dist, mpg, fuel_left):
	return dist <= fuel_left * mpg


def zero_fuel(d, mpg, fuel):
	while d == mpg * fuel or d <= mpg * fuel:
		return True
	else:
		return False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	voi_ajaa = mpg * fuel_left
	if voi_ajaa >= distance_to_pump:
		return True
	return False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	a = fuel_left
	b = mpg
	c = distance_to_pump
	if a * b >= c:
		return True
	else:
		return False


def zero_fuel(d, v, g):
	if d <= v * g:
		return True
	else:
		return False


import math

def zero_fuel(distance_to_pump, mpg, fuel_left):
	x = int(distance_to_pump)
	y = int(mpg)
	z = int(fuel_left)
	p = y * z / x
	if p >= 1:
		return True
	else:
		return False


def zero_fuel(distance_to_pump, mpg, fuel_left):
	fn = distance_to_pump - mpg * fuel_left
	if fn <= 0:
		return True
	else:
		return False