forked from tdwojak/Python2017
Resolved
This commit is contained in:
parent
02728e80a3
commit
4f6c4e9062
@ -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))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user