kyu_4.the_greatest_warrior package

Submodules

kyu_4.the_greatest_warrior.test_battle module

class kyu_4.the_greatest_warrior.test_battle.BattleTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing Battle method

test_battle()[source]

Testing Battle method

kyu_4.the_greatest_warrior.test_warrior module

class kyu_4.the_greatest_warrior.test_warrior.WarriorTestCase(methodName='runTest')[source]

Bases: unittest.case.TestCase

Testing Warrior class

test_warrior_bruce_lee()[source]

Testing Warrior class >>> bruce_lee

test_warrior_tom()[source]

Testing Warrior class >>> tom

kyu_4.the_greatest_warrior.warrior module

The Greatest Warrior

class kyu_4.the_greatest_warrior.warrior.Warrior[source]

Bases: object

A class called Warrior which calculates and keeps track of level and skills, and ranks.

__set_level() → int

A warrior starts at level 1 and can progress all the way to 100.

A warrior cannot progress beyond level 100.

Each time the warrior’s experience increases by another 100, the warrior’s level rises to the next level.

Returns

__set_rank() → str
Returns

warrior’s experience

__update_experience(experience: int)

A warrior’s experience is cumulative, and does not reset with each rise of level. The only exception is when the warrior reaches level 100, with which the experience stops at 10000. :return:

property achievements
battle(enemy_level: int)[source]
property experience
property level

A warrior’s level

Returns

A warrior’s level

property rank

A warrior starts at rank “Pushover” and can progress all the way to “Greatest”

Returns

warrior’s rank

training(params: list) → str[source]
Training will accept an array of three elements:

the description, the experience points your warrior earns, and the minimum level requirement.

Parameters

params

Returns

Module contents