kyu_4.the_greatest_warrior package
Submodules
kyu_4.the_greatest_warrior.test_battle module
Test for -> The Greatest Warrior -> test battle.
Created by Egor Kostan. GitHub: https://github.com/ikostan
kyu_4.the_greatest_warrior.test_warrior module
Test for -> The Greatest Warrior -> test warrior.
Created by Egor Kostan. GitHub: https://github.com/ikostan
kyu_4.the_greatest_warrior.warrior module
Solution for -> The Greatest Warrior.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- class kyu_4.the_greatest_warrior.warrior.Warrior[source]
Bases:
objectWarrior class.
A class called Warrior which calculates and keeps track of level and skills, and ranks.
- __set_level() int
Set level.
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:
int
- __set_rank() str
Set rank.
- Returns:
warrior’s experience
- __update_experience(experience: int) None
Update experience.
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: list
Return achievements as a list.
- Returns:
list
- battle(enemy_level: int) str[source]
Return message based on the result of the battle.
- Parameters:
enemy_level – int
- Returns:
str
- property experience: int
Return experience value.
- Returns:
int
- property level: int
A warrior’s level.
- Returns:
A warrior’s level
- property rank: str
Rank.
A warrior starts at rank “Pushover” and can progress all the way to “Greatest”.
- Returns:
warrior’s rank
Module contents
The Greatest Warrior package.