1
0
forked from tdwojak/Python2017
This commit is contained in:
Przemysław Kaczmarek 2017-11-28 19:12:03 +01:00
parent 02728e80a3
commit 4f6c4e9062

View File

@ -9,7 +9,20 @@ Np. leet('leet') powinno zwrócić '1337'.
def leet_speak(text):
pass
new_text=[]
for i in range(len(text)):
if text[i] == 'e':
new_text.append('3')
elif text[i] == 'l':
new_text.append('1')
elif text[i] == 'o':
new_text.append('0')
elif text[i] == 't':
new_text.append('7')
else:
new_text.append(text[i])
return ("".join(new_text))
def tests(f):
@ -24,3 +37,5 @@ def tests(f):
if __name__ == "__main__":
print(tests(leet_speak))