kyu_8.will_you_make_it package

Submodules

kyu_8.will_you_make_it.test_zero_fuel module

Tests for -> Will you make it?.

Created by Egor Kostan. GitHub: https://github.com/ikostan

class kyu_8.will_you_make_it.test_zero_fuel.ZeroFuelTestCase(methodName='runTest')[source]

Bases: TestCase

Testing zero_fuel function.

_classSetupFailed = False
_class_cleanups = []
test_zero_fuel = None
test_zero_fuel_0(**kw)

Testing the function with various test data [with data=(50, 25, 2), expected=True].

Returns:

test_zero_fuel_1(**kw)

Testing the function with various test data [with data=(100, 50, 1), expected=False].

Returns:

kyu_8.will_you_make_it.zero_fuel module

Solution for -> Will you make it?.

Created by Egor Kostan. GitHub: https://github.com/ikostan

kyu_8.will_you_make_it.zero_fuel.zero_fuel(distance_to_pump: int, mpg: int, fuel_left: int) bool[source]

‘zero_fuel’ function.

You were camping with your friends far away from home, but when it’s time to go back, you realize that you 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. :param distance_to_pump: int :param mpg: int :param fuel_left: int :return: bool

Module contents

Will you make it?.