diff --git a/labs02/task09.py b/labs02/task09.py index d53dc9f..e2c67fa 100644 --- a/labs02/task09.py +++ b/labs02/task09.py @@ -9,18 +9,22 @@ Np. leet('leet') powinno zwrócić '1337'. def leet_speak(text): - lista_temp = [] - for i in text: + text_tmp = str(text) + text_tmp = text_tmp.replace('[', '') + text_tmp = text_tmp.replace(']', '') + text_tmp = text_tmp.replace("'", '') + lista_temp = "" + for i in text_tmp: if i =='e': - lista_temp +=3 + lista_temp.append('3') elif i =='l': - lista_temp +=1 + lista_temp.append('1') elif i =='o': - lista_temp +=0 + lista_temp.append('0') elif i =='t': - lista_temp +=7 + lista_temp.append('7') else: - lista_temp += i + lista_temp.append(i) return lista_temp def tests(f):