forked from tdwojak/Python2017
Update 'labs02/task09.py'
This commit is contained in:
parent
d2eeea8a25
commit
7934874c58
@ -9,9 +9,17 @@ Np. leet('leet') powinno zwrócić '1337'.
|
|||||||
|
|
||||||
|
|
||||||
def leet_speak(text):
|
def leet_speak(text):
|
||||||
|
replacements = ( ('e','3'), ('l','1'),
|
||||||
|
('o','0'), ('o','7') )
|
||||||
|
my_string = text
|
||||||
|
new_string = my_string
|
||||||
|
for old, new in replacements:
|
||||||
|
new_string = new_string.replace(old, new)
|
||||||
|
return new_string
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def tests(f):
|
def tests(f):
|
||||||
inputs = [['leet'], ['do not want']]
|
inputs = [['leet'], ['do not want']]
|
||||||
outputs = ['1337', 'd0 n07 wan7']
|
outputs = ['1337', 'd0 n07 wan7']
|
||||||
|
Loading…
Reference in New Issue
Block a user