kyu_8.wolf_in_sheep_clothing package

Submodules

kyu_8.wolf_in_sheep_clothing.test_wolf_in_sheep_clothing module

Tests for -> A wolf in sheep’s clothing.

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

class kyu_8.wolf_in_sheep_clothing.test_wolf_in_sheep_clothing.WarnTheSheepTestCase(methodName='runTest')[source]

Bases: TestCase

Testing warn_the_sheep function.

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

Test the ‘warn’ func when the wolf in the end.

If the wolf is not the closest animal to you, return “Oi! Sheep number N! You are about to be eaten by a wolf!” where N is the sheep’s position in the queue. :return:

test_warn_the_sheep_wolf_at_start()[source]

Test the ‘warn’ func when the wolf in the beginning.

If the wolf is the closest animal to you, return “Pls go away and stop eating my sheep”. :return:

test_warn_the_sheep_wolf_in_middle()[source]

Test the ‘warn’ func when the wolf in the middle.

If the wolf is the closest animal to you, return “Pls go away and stop eating my sheep”. :return:

kyu_8.wolf_in_sheep_clothing.wolf_in_sheep_clothing module

Solution for -> A wolf in sheep’s clothing.

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

kyu_8.wolf_in_sheep_clothing.wolf_in_sheep_clothing.warn_the_sheep(queue: list) str[source]

Warn the sheep in front of the wolf.

If the wolf is the closest animal to you, return “Pls go away and stop eating my sheep”.

Otherwise, return “Oi! Sheep number N! You are about to be eaten by a wolf!” where N is the sheep’s position in the queue.

Parameters:

queue – list

Returns:

str

Module contents

A wolf in sheep’s clothing.