I found an interesting problem on https://www.codewars.com/kata/5941c545f5c394fef900000c:
![alt text](https://2.bp.blogspot.com/-DNNiOXduuvQ/Vh-FR-qbKXI/AAAAAAAAEOA/HT0IzJ36zW4/s1600/voz.jpg)

Create a class called `Warrior` which calculates and keeps track of their level and skills, and ranks them as the warrior they've proven to be.

Business Rules:

- A warrior starts at level 1 and can progress all the way to 100.
- A warrior starts at rank `"Pushover"` and can progress all the way to `"Greatest"`.
- The only acceptable range of rank values is `"Pushover", "Novice", "Fighter", "Warrior", "Veteran", "Sage", "Elite", "Conqueror", "Champion", "Master", "Greatest"`.
- Warriors will compete in battles. Battles will always accept an enemy level to match against your own.
- With each battle successfully finished, your warrior's experience is updated based on the enemy's level.
- The experience earned from the battle is relative to what the warrior's current level is compared to the level of the enemy.
- A warrior's experience starts from 100. Each time the warrior's experience increases by another 100, the warrior's level rises to the next level.
- 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
- At every 10 levels, your warrior will reach a new rank tier. (ex. levels 1-9 falls within `"Pushover"` tier, levels 80-89 fall within `"Champion"` tier, etc.)
- A warrior cannot progress beyond level 100 and rank `"Greatest"`.

Battle Progress Rules & Calculations:

- If an enemy level does not fall in the range of 1 to 100, the battle cannot happen and should return `"Invalid level"`.
- Completing a battle against an enemy with the same level as your warrior will be worth 10 experience points.
- Completing a battle against an enemy who is one level lower than your warrior will be worth 5 experience points.
- Completing a battle against an enemy who is two levels lower or more than your warrior will give 0 experience points.
- Completing a battle against an enemy who is one...

I tried it in Python, but could not do it. Can you solve it?
class Warrior():
    def __init__(self) :
        self.level = 1
        self.experience = 100
        self.rank = "Pushover"
        self.achievements = [] 
        self.max_level = 100
        self.available_ranks = ["Pushover", "Novice", "Fighter", "Warrior", "Veteran", "Sage", "Elite", "Conqueror", "Champion", "Master", "Greatest"]

    def battle(self, enemy_level) :
        if enemy_level < 1 or enemy_level > 100 :
            return "Invalid level"
        if enemy_level <= self.level :
            diff = self.level - enemy_level
            self._get_experience(10 // (diff + 1))
            if diff > 1 :
                return "Easy fight"
            else :
                return "A good fight"
        else :
            diff = enemy_level - self.level
            if diff >= 5 and enemy_level // 10 > self.level // 10 :
                return "You've been defeated"
            else :
                self._get_experience(20 * diff * diff)
                return "An intense fight"
    
    def training(self, achievement) :
        description = achievement[0]
        experience = achievement[1]
        min_level = achievement[2]
        if self.level >= min_level :
            self.achievements.append(description)
            self._get_experience(experience)
            return description
        else :
            return "Not strong enough"
    
    def _get_experience(self, experience) :
        if experience >= 5 :
            self.experience += experience  
            self.level = self.experience // 100
            if self.level >= self.max_level :            
                self.level = self.max_level 
                self.experience = self.max_level * 100
            self.rank = self.available_ranks[self.experience // 1000]