forked from tdwojak/Python2017
changed file task 09
This commit is contained in:
parent
121db08b43
commit
587c6d52a6
@ -9,11 +9,16 @@ Np. leet('leet') powinno zwrócić '1337'.
|
|||||||
|
|
||||||
|
|
||||||
def leet_speak(text):
|
def leet_speak(text):
|
||||||
let_dict = {'e': 3, 'l': 1, 'o': 0, 't': 7}
|
let_dict = {'e': '3', 'l': '1', 'o': '0', 't': '7'}
|
||||||
|
new_word = []
|
||||||
for n in text:
|
for n in text:
|
||||||
if n in let_dict:
|
if n in let_dict:
|
||||||
x = let_dict[n]
|
x = let_dict[n]
|
||||||
return text
|
new_word.append(x)
|
||||||
|
else:
|
||||||
|
new_word.append(n)
|
||||||
|
new_word_joined = ''.join(new_word)
|
||||||
|
return new_word_joined
|
||||||
|
|
||||||
|
|
||||||
def tests(f):
|
def tests(f):
|
||||||
|
Loading…
Reference in New Issue
Block a user