1
0
forked from tdwojak/Python2017
Python2017/Homework/labs02/task09_rev.py

19 lines
470 B
Python
Raw Normal View History

2018-01-22 00:50:22 +01:00
## 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))