<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Indentation
Okay guys, I hope you are starting to get excited, I say that because we are only 1-2 lectures away from having all the necessary syntax for writing interesting programmes with Python.
Today I shall be talking about indentation. In other languages, curly brackets ("{}") are used to seperate out blocks of code. In python that same work is done via indentation. The syntax
Step1:  <img src= attachment
Step2:  In the above code snippet we have three lines of error prone code; we cant add ints to strings and we cant divide by zero and we cant add objects that have yet to be defined. and yet, Python ran just fine. The reason being I have already eluded to; Python ignores those three lines of code because 'A' does not equal 11. 
To summarise quickly indentation is all about organising code and controlling the 'flow' of the program. Messing up indentation is a VERY COMMON beginner error to make, so don't feel bad if you end up incorrectly indenting bits of code.
Let me quickly show you how easy it is.
Step3:  So this code goes through the numbers 1-to-10 and calculates the square of the number. Now in this case only one number gets printed (100), which happens to be 10x10.
Okay, so now lets take the same bit of code, but this time we are going to indent the print statement. Before we run it I want you to have a guess as to what you think will happen.
Step4:  So we changed the indentation of the print statement and we get a completely different behaviour. In the first case we print one number and in the second case we print ten numbers. 
To understand what's going one we can once again return to the drawing boxes visualization
Step5:  Unlike before, we get an error message this time. In this case the problem is the b=2 line, followed by an intended print statement. The fix here is to either indent b=2 or dedent the print statement. The correct approach will be dependant upon what your code is suppose to do. And lastly
Step6:  Once again, we have two bits of code that will act very differently from one another and the only difference is indentation. In version (A) what happens is we check if 'A' is True and if it is we check if 'B' is True. In the second case, we check if 'B' is True independently of whether 'A' is True.
In short, indentation can be a tricky thing to get right. And this difficulty is compounded by the fact in many cases incorrect code is still syntactically correct. And that means instead of error messages you just get the wrong result.
If, elif, else
As you (hopefully) remember we have already covered if and else in-line; in a previous lecture we were doing stuff like
Step7:  So our code was called on the numbers 2, 5, 33 and 100. If then printed out a few statements, you should notice the last two lines contradict each other, 100 cannot be both even and odd!
How did this happen, well, we used an if statement when we should have used an elif statement. You see, what is currently happening is that Python first checks to see if 100 is even (it is) and so it executes the relevant code block (i.e printing 100 is even). Next it sees another if statement which asks if he current number is greater than 10 (it is), and so 100 is odd AND..." gets printed. 
Basically, if we have multiple if statements next to each of Python checks each one (if statements, at the same indentation level, are independent). Whereas an elif statement is only checked if the if statement above it equates to False. Thus, a simple fix to our program is to use 'elif' instead of 'if'. Like so
Step8:  Homework Assignment
Directly below is houses and kittens, a D&D knock-off. The game was ready to be published but unfortunately mysterious computer pixies (sometimes known as 'byte imps') have messed up the indentation of the code and it no longer works. On the bright-side the byte imps have only tinkered with the indentation and nothing else.
With this knowledge can you fix the game?
<ASSISTANT_TASK:>
Python Code:
if 1:
    used_tab = True
	if used_tab:
		used_spaces = True
		print("Something Something")
Explanation: Indentation
Okay guys, I hope you are starting to get excited, I say that because we are only 1-2 lectures away from having all the necessary syntax for writing interesting programmes with Python.
Today I shall be talking about indentation. In other languages, curly brackets ("{}") are used to seperate out blocks of code. In python that same work is done via indentation. The syntax:
{some code, e.g an if statement}:
{tab or 4 spaces} {code block}
When I say 'tab or 4 spaces', make sure your program in consistent; Python does not like it when you use tabs in some places and spaces in another. For example:
End of explanation
a = 10
if a == 11:
    a += "abc"                  # a (an int) + "abc" should be a type error!
    10/0                        # dividing by zero should raise a zero division error!
    dave + hat + seven_turnips  # should be a name error, none of these things are defined!
else:
    print(a*a)
Explanation: <img src= attachment:indentguide.png) style="width: 200px;"/>
Okay, so what does indentation actually do? Basically, its a way to tell Python how to move around your code. Lets look at the image below:
The numbers in grey '(1)', '(2)' and so on represent the indentation level, and the coloured squares represent the 'blocks' of code. At the highest level is the 'black square', in this particular instance in contains a function named 'function' and a variable named 'Z'. 
The line of code "if A" decides whether we enter the 'lime-green-box' or not, if  A happens to be false we skip all of the code with lime-green-box and instead just move to the else statement which tells us return "something something". Likewise, the "if B" line of code decides whether we enter the 'turquoise-box' of code (or not). If not, we return A. The only time this function returns D is when A,B,C,and D are all True, and that is because this is the only path that leads to the line ‘return D’. 
In short, indentation is a way of 'sectioning off' code. As a matter of fact Python completely ignores code blocks it doesn’t enter. Here's proof:
End of explanation
for i in range(1, 11):
    square = i*i
print(square)
Explanation: In the above code snippet we have three lines of error prone code; we cant add ints to strings and we cant divide by zero and we cant add objects that have yet to be defined. and yet, Python ran just fine. The reason being I have already eluded to; Python ignores those three lines of code because 'A' does not equal 11. 
To summarise quickly indentation is all about organising code and controlling the 'flow' of the program. Messing up indentation is a VERY COMMON beginner error to make, so don't feel bad if you end up incorrectly indenting bits of code.
Let me quickly show you how easy it is.
End of explanation
for i in range(1, 11):
    square = i*i
    print(square) # <--- now indented...
Explanation: So this code goes through the numbers 1-to-10 and calculates the square of the number. Now in this case only one number gets printed (100), which happens to be 10x10.
Okay, so now lets take the same bit of code, but this time we are going to indent the print statement. Before we run it I want you to have a guess as to what you think will happen.
End of explanation
for i in range(10):
    a = 3
b = 2
    print(i)
Explanation: So we changed the indentation of the print statement and we get a completely different behaviour. In the first case we print one number and in the second case we print ten numbers. 
To understand what's going one we can once again return to the drawing boxes visualization:
In both versions the green-box contains the same code, but the dark-red-boxes differ; in version(A) the print statement is excluded from the red-block whereas in version(B) the print statement is in red-block. In this code, the red-block gets executed ten times (once for each number). And so therefore if the print statement is in the red-block is gets executed ten times whereas if it is outside it gets executed just once. And that fully accounts for the difference of behaviour in this case. 
Another example:
End of explanation
a = b =  ""
# Version (A):
if a:
    pass
    if b:
        pass
# Version (B): 
if a:
    pass
if b:
    pass
Explanation: Unlike before, we get an error message this time. In this case the problem is the b=2 line, followed by an intended print statement. The fix here is to either indent b=2 or dedent the print statement. The correct approach will be dependant upon what your code is suppose to do. And lastly:
End of explanation
# Takes a number and prints if it is even, odd AND >10, or less than 10
# Take note of the indentation guys!
for number in [2, 5, 33, 100]:
    if number % 2 == 0: # number is even
        print("{} is even".format(number))
    if number > 10:
        print("{} is odd AND greater than 10".format(number))
    else:
        pass  # pass is a way to make python do nothing.
Explanation: Once again, we have two bits of code that will act very differently from one another and the only difference is indentation. In version (A) what happens is we check if 'A' is True and if it is we check if 'B' is True. In the second case, we check if 'B' is True independently of whether 'A' is True.
In short, indentation can be a tricky thing to get right. And this difficulty is compounded by the fact in many cases incorrect code is still syntactically correct. And that means instead of error messages you just get the wrong result.
If, elif, else
As you (hopefully) remember we have already covered if and else in-line; in a previous lecture we were doing stuff like: 
a = True
b = 10 if a else 0
But now we have covered indentation we can examine how to use if/elif/else statements. The Syntax:
if {condition}:
    {code block}
elif {condition}:
    {code block}
else:
    {code block}
We already understand if/else, so the question is "what does 'elif' do?" Well, it stands for 'else if' and it is probably best understood by example:
End of explanation
for number in [2, 5, 33, 100]:
    if number % 2 == 0: 
        print("{} is even".format(number))
    elif number > 10:    # <--- This is the ONLY LINE that has changed. 
        print("{} is odd AND greater than 10".format(number))
    else:
        pass
Explanation: So our code was called on the numbers 2, 5, 33 and 100. If then printed out a few statements, you should notice the last two lines contradict each other, 100 cannot be both even and odd!
How did this happen, well, we used an if statement when we should have used an elif statement. You see, what is currently happening is that Python first checks to see if 100 is even (it is) and so it executes the relevant code block (i.e printing 100 is even). Next it sees another if statement which asks if he current number is greater than 10 (it is), and so 100 is odd AND..." gets printed. 
Basically, if we have multiple if statements next to each of Python checks each one (if statements, at the same indentation level, are independent). Whereas an elif statement is only checked if the if statement above it equates to False. Thus, a simple fix to our program is to use 'elif' instead of 'if'. Like so:
End of explanation
## HOUSES AND KITTENS, A D&D KNOCK-OFF ### 
#### THIS CODE IS A MESS, FIX THE INDENTATION
 quest = "KILL KITTEN"
        current_xp = 20
next_level_xp = 100
   weapon_of_choice = "sponge mallet"
    is_dead = False
     attack_dmg = 10
                    enemy_health = 10
print('\nGAMEMASTER says: "{} does {} and the enemy has {} health do you want to attack?"\n'.format(weapon_of_choice, attack_dmg, enemy_health))
    atk = input('Enter "Y" to attack, else "N"')
    do_attack = True if atk == "Y" else False
if do_attack:
    enemy_health -= attack_dmg
    if enemy_health == 0:
is_dead = True
    if is_dead:
        print('INKEEPER says: "OMG WHAT DID YOU DO!!!!, WHY DID YOU KILL THAT POOR LITTLE KITTEN WITH YOUR {}? ..YOU..MONSTER!!!"'.format(weapon_of_choice.upper()))
            if quest == "KILL KITTEN":
            print('\nGAMEMASTER says: "Our brave hero completes his quest. + 80 xp"\n')
            current_xp += 80
            print('INKEEPER says: "I have a baby seal in the swimming pool if you want to club that too?"'.format(weapon_of_choice))
        new_quest_accept = input('GAMEMASTER says: "DO YOU ACCEPT THE CLUB POOR SEAL QUEST? Type Y or N"\n')    
    if new_quest_accept == "Y":
                quest = "CLUB BABY SEAL"
                print('INKEEPER says: "YES!? I was being sarcastic you twit, why on earth would I give you a quest to harm by baby seal?"')
                else:
                print('INKEEPER says: "NO? Well THANKYOU for not killing every living thing in my house. Speaking of which, Why are you even in my house? GET OUT GET OUT YOU FOUL BEAST!!"')
    elif do_attack and not is_dead:
print('INKEEPER says: "SNUFFLES!!! WHAT DID HE DO TO YOU!!! SOMEONE PLEASE FETCH A CAT DOCTOR"')
    if current_xp == next_level_xp:
        print('\nGAMEMASTER says: "LEVEL UP!!, {} now does +2 attack"\n'.format(weapon_of_choice))
        attack_dmg += 2
            else:
print('INKEEPER says: "Thankyou kind sir for not maiming my little kitten with your {}"'.format(weapon_of_choice))
Explanation: Homework Assignment
Directly below is houses and kittens, a D&D knock-off. The game was ready to be published but unfortunately mysterious computer pixies (sometimes known as 'byte imps') have messed up the indentation of the code and it no longer works. On the bright-side the byte imps have only tinkered with the indentation and nothing else.
With this knowledge can you fix the game?
End of explanation
<END_TASK>