0
0
forked from tdwojak/Python2018

zadania 11

This commit is contained in:
s441405 2018-06-02 14:03:41 +02:00
parent 331db64830
commit 94edd37744

View File

@ -9,8 +9,15 @@ Oba napisy będą składać się wyłacznie z małych liter.
""" """
def common_chars(string1, string2): def common_chars(string1, string2):
pass string1 = set(string1.replace(" ", ""))
string2 = set(string2.replace(" ", ""))
string12 = []
for a1 in string1:
for a2 in string2:
if a1 == a2:
string12.append(a1)
string12.sort()
return string12
def tests(f): def tests(f):
inputs = [["this is a string", "ala ma kota"]] inputs = [["this is a string", "ala ma kota"]]