kyu_8.will_there_be_enough_space package

Submodules

kyu_8.will_there_be_enough_space.enough module

Solution for -> Will there be enough space?.

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

kyu_8.will_there_be_enough_space.enough.enough(cap: int, on: int, wait: int) int[source]

‘enough’ function.

The driver wants you to write a simple program telling him if he will be able to fit all the passengers.

If there is enough space, return 0, and if there isn’t, return the number of passengers he can’t take.

You have to write a function that accepts three parameters:

cap is the amount of people the bus can hold excluding the driver. on is the number of people on the bus. wait is the number of people waiting to get on to the bus. :param cap: int :param on: int :param wait: int :return: int

kyu_8.will_there_be_enough_space.test_enough module

Tests for -> Will there be enough space?.

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

class kyu_8.will_there_be_enough_space.test_enough.EnoughTestCase(methodName='runTest')[source]

Bases: TestCase

Testing enough function.

_classSetupFailed = False
_class_cleanups = []
test_enough = None
test_enough_0(**kw)

Testing enough function with various test data [with test_dat=(10, 5, 5), expected=0].

Returns:

test_enough_1(**kw)

Testing enough function with various test data [with test_dat=(100, 60, 50), expected=10].

Returns:

test_enough_2(**kw)

Testing enough function with various test data [with test_dat=(20, 5, 5), expected=0].

Returns:

Module contents

Will there be enough space.