kyu_7.coloured_triangles package

Submodules

kyu_7.coloured_triangles.solution_for_triangle module

Solution for -> Coloured Triangles.

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

kyu_7.coloured_triangles.solution_for_triangle.triangle(row: str) str[source]

Triangle function.

You will be given the first row of the triangle as a string, and it’s your job to return the final colour which would appear in the bottom row as a string. I

Parameters:

row – str, the first row of the triangle as a string

Returns:

str, return the final colour

kyu_7.coloured_triangles.test_triangle module

Test for -> Coloured Triangles.

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

class kyu_7.coloured_triangles.test_triangle.TriangleTestCase(methodName='runTest')[source]

Bases: TestCase

Testing triangle function.

_classSetupFailed = False
_class_cleanups = []
test_triangle = None
test_triangle_00_GB(**kw)

Basic test case [with string=’GB’, expected=’R’].

Returns:

test_triangle_01_RRR(**kw)

Basic test case [with string=’RRR’, expected=’R’].

Returns:

test_triangle_02_RGBG(**kw)

Basic test case [with string=’RGBG’, expected=’B’].

Returns:

test_triangle_03_RBRGBRB(**kw)

Basic test case [with string=’RBRGBRB’, expected=’G’].

Returns:

test_triangle_04_RBRGBRBGGRRRBGBBBGG(**kw)

Basic test case [with string=’RBRGBRBGGRRRBGBBBGG’, expected=’G’].

Returns:

test_triangle_05_B(**kw)

Basic test case [with string=’B’, expected=’B’].

Returns:

test_triangle_06_BGBGB(**kw)

Basic test case [with string=’BGBGB’, expected=’R’].

Returns:

test_triangle_07_BBRRBRGBRRBRGRRBGGRRBBGBGGRGGB(**kw)

Basic test case [with string=’BBRRBRGBRRBRGRRBGGRRBBGBGGRGGB’, expected=’G’].

Returns:

test_triangle_08_RB(**kw)

Basic test case [with string=’RB’, expected=’G’].

Returns:

test_triangle_09_GRBGRGBBRBRGRRGGGGRBRBRGGRB(**kw)

Basic test case [with string=’GRBGRGBBRBRGRRGGGGRBRBRGGRB’, expected=’B’].

Returns:

test_triangle_10_BBGRBGRRGGGRRBRBRBGRBGRRRBBBG(**kw)

Basic test case [with string=’BBGRBGRRGGGRRBRBRBGRBGRRRBBBG’, expected=’G’].

Returns:

test_triangle_11_RRBBRRGBRBGBRBRGBGGRBBBBRGGRGB(**kw)

Basic test case [with string=’RRBBRRGBRBGBRBRGBGGRBBBBRGGRGB’, expected=’R’].

Returns:

test_triangle_12_GGBRGBBRBGRRGGGBGBGRGBGGRGRB(**kw)

Basic test case [with string=’GGBRGBBRBGRRGGGBGBGRGBGGRGRB’, expected=’R’].

Returns:

test_triangle_13_BRBBGGRGBGGGBGRBRGRGRRBBGBR(**kw)

Basic test case [with string=’BRBBGGRGBGGGBGRBRGRGRRBBGBR’, expected=’G’].

Returns:

test_triangle_14_GBBRBRGGGGBRGGBBGGBGBRGRBGRGBB(**kw)

Basic test case [with string=’GBBRBRGGGGBRGGBBGGBGBRGRBGRGBB’, expected=’G’].

Returns:

test_triangle_15_RRRBRRGRRGBGBBRGRGRGRB(**kw)

Basic test case [with string=’RRRBRRGRRGBGBBRGRGRGRB’, expected=’B’].

Returns:

test_triangle_16_BRGGRBBBBGBRRRRBRBRRBGBGRBGB(**kw)

Basic test case [with string=’BRGGRBBBBGBRRRRBRBRRBGBGRBGB’, expected=’B’].

Returns:

test_triangle_17_RRBRBRBBBBBRBRRBBBGBBGBGGGRGR(**kw)

Basic test case [with string=’RRBRBRBBBBBRBRRBBBGBBGBGGGRGR’, expected=’G’].

Returns:

Module contents

Coloured Triangles.