From 7934874c5887ef711a82cf5ca85af50a8c1586b5 Mon Sep 17 00:00:00 2001 From: s45164 Date: Fri, 1 Dec 2017 17:12:26 +0000 Subject: [PATCH] Update 'labs02/task09.py' --- labs02/task09.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/labs02/task09.py b/labs02/task09.py index 9045054..200d121 100644 --- a/labs02/task09.py +++ b/labs02/task09.py @@ -9,9 +9,17 @@ Np. leet('leet') powinno zwrócić '1337'. 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 + def tests(f): inputs = [['leet'], ['do not want']] outputs = ['1337', 'd0 n07 wan7']