update #2
@ -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"]]
|
||||||
|
Loading…
Reference in New Issue
Block a user