forked from tdwojak/Python2017
19 lines
470 B
Python
19 lines
470 B
Python
|
## final version L02T09
|
||
|
|
||
|
def leet_speak(words):
|
||
|
return words.replace("e","3").replace("l","1").replace("o","0").replace("t","7")
|
||
|
|
||
|
|
||
|
def tests(f):
|
||
|
inputs = [['leet'], ['do not want']]
|
||
|
outputs = ['1337', 'd0 n07 wan7']
|
||
|
|
||
|
for input, output in zip(inputs, outputs):
|
||
|
if f(*input) != output:
|
||
|
return "ERROR: {}!={}".format(f(*input), output)
|
||
|
break
|
||
|
return "TESTS PASSED"
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
print(tests(leet_speak))
|