1
0
forked from tdwojak/Python2018

Zadanie domowe

This commit is contained in:
Magda Zganiacz 2018-06-02 19:46:40 +02:00
parent c4cf32a7f8
commit 02e9da89d2

View File

@ -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