From 1a4de39386e3e5770181ddbad4868196b0d3e3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Jasku=C5=82a?= Date: Sat, 2 Jun 2018 17:38:54 +0000 Subject: [PATCH] zrobiono zadanie 11 --- labs02/task11.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/labs02/task11.py b/labs02/task11.py index 7d36767..905d1f0 100644 --- a/labs02/task11.py +++ b/labs02/task11.py @@ -9,7 +9,12 @@ Oba napisy będą składać się wyłacznie z małych liter. """ def common_chars(string1, string2): - pass + s1 = string1.replace(' ','') + s2 = string2.replace(' ','') + s1=set(s1) + s2=set(s2) + common = s1 & s2 + return(sorted(list(common))) def tests(f): @@ -23,4 +28,4 @@ def tests(f): return "TESTS PASSED" if __name__ == "__main__": - print(tests(common_chars)) + print(tests(common_chars)) \ No newline at end of file