Q:

Break if statement in python

i have mistake with my python code. There's mini game about guessing code. i want to break if statements and make else statement (activated when i guess wrong letter).Here's the code. Return and break function outputs: "return/break function outside the loop". Please, modify the code :D 
`
import time
print('Oto jest gra, w której musisz odgadnąć kod! Kod ma 4 litery!')
decyzja = input('Chcesz grać? T/N\n')
if decyzja == "t" or "T":
    one = input('Wpisz 1 litere\n')
    if one == "k":
        two = input('Wpisz 2 Litere\n')
        if two == "u":
            three = input('Wpisz 3 litere\n')
            if three == "b":
                four = input('Ostatnia!\n')
                if four == "a":
                    time.sleep(2)
                    print('Zgadles kod!!!')

`

A:

Try this (it's better to use a function):
import time

def numguess(myinput):
    if decyzja.lower() == "t":
        one = input('Wpisz 1 litere\n')
    else:
        return False

    if one == "k":
        two = input('Wpisz 2 Litere\n')
    else:
        return False

    if two == "u":
        three = input('Wpisz 3 litere\n')
    else:
        return False

    if three == "b":
        four = input('Ostatnia!\n')
    else:
        return False

    if four == "a":
        time.sleep(2)
        print('Zgadles kod!!!')
    else:
        return False

print('Oto jest gra, w której musisz odgadnąć kod! Kod ma 4 litery!')

decyzja = input('Chcesz grać? T/N\n')

numguess(decyzja)

