From 02e9da89d242d2dbfcd60f21c0537d6bc700b1c6 Mon Sep 17 00:00:00 2001 From: Magda Zganiacz Date: Sat, 2 Jun 2018 19:46:40 +0200 Subject: [PATCH] Zadanie domowe --- labs02/task11.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/labs02/task11.py b/labs02/task11.py index 8f10e7b..7e9ec78 100644 --- a/labs02/task11.py +++ b/labs02/task11.py @@ -10,12 +10,12 @@ Oba napisy będą składać się wyłacznie z małych liter. def common_chars(string1, string2): lista = [] - str1 = set(string1) - str2 = set(string2) + str1 = set(string1.replace(' ', '')) + str2 = set(string2.replace(' ', '')) for i in str1: for j in str2: - if i == j and i != ' ': - lista += i + if i == j: + lista.append(i) lista.sort() return lista