kyu_8.century_from_year package

Submodules

kyu_8.century_from_year.century module

Solution for -> Century From Year.

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

kyu_8.century_from_year.century.century(year: int) int[source]

Given a year, return the century it is in.

Parameters:

year – int

Returns:

int

kyu_8.century_from_year.test_century module

Test for -> Century From Year.

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

class kyu_8.century_from_year.test_century.CenturyTestCase(methodName='runTest')[source]

Bases: TestCase

Testing century function.

The first century spans from the year 1 up to and including the year 100, The second - from the year 101 up to and including the year 200, etc.

_classSetupFailed = False
_class_cleanups = []
test_century = None
test_century_0(**kw)

Testing century function with various test data [with year=1705, expected=18, message=’Testing for year 1705’].

Returns:

test_century_1(**kw)

Testing century function with various test data [with year=1900, expected=19, message=’Testing for year 1900’].

Returns:

test_century_2(**kw)

Testing century function with various test data [with year=1601, expected=17, message=’Testing for year 1601’].

Returns:

test_century_3(**kw)

Testing century function with various test data [with year=2000, expected=20, message=’Testing for year 2000’].

Returns:

test_century_4(**kw)

Testing century function with various test data [with year=356, expected=4, message=’Testing for year 356’].

Returns:

test_century_5(**kw)

Testing century function with various test data [with year=89, expected=1, message=’Testing for year 89’].

Returns:

Module contents

Century From Year.