kyu_7.beginner_series_sum_of_numbers package

Submodules

kyu_7.beginner_series_sum_of_numbers.sum_of_numbers module

Beginner Series #3 Sum of Numbers.

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

kyu_7.beginner_series_sum_of_numbers.sum_of_numbers.get_sum(a: int, b: int) int[source]

Get sum.

Given two integers a and b, which can be positive or negative, find the sum of all the numbers between including them too and return it. If the two numbers are equal return a or b. :param a: :param b: :return:

kyu_7.beginner_series_sum_of_numbers.test_sum_of_numbers module

Test for -> Sum of Numbers.

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

class kyu_7.beginner_series_sum_of_numbers.test_sum_of_numbers.SumOfNumbersTestCase(methodName='runTest')[source]

Bases: TestCase

Testing get_sum function.

_classSetupFailed = False
_class_cleanups = []
test_get_sum_equal_numbers()[source]

Test that ‘a’ and ‘b’ are equal.

Returns:

test_get_sum_negative_numbers()[source]

Test ‘a’ or ‘b’ is negative.

Returns:

test_get_sum_positive_numbers()[source]

Test ‘a’ an ‘b’ are positive numbers.

Returns:

Module contents

Beginner Series #3 Sum of Numbers.