forked from tdwojak/Python2017
task11 fixed
This commit is contained in:
parent
6f36635a56
commit
6bce9cdb6a
@ -11,13 +11,10 @@ Oba napisy będą składać się wyłacznie z małych liter.
|
|||||||
def common_chars(string1, string2):
|
def common_chars(string1, string2):
|
||||||
wspolne = []
|
wspolne = []
|
||||||
|
|
||||||
for z1 in string1:
|
for z in string1.replace(" ", ""):
|
||||||
for z2 in string2:
|
if z in string2.replace(" ", "") and z not in wspolne:
|
||||||
if z1 == z2:
|
wspolne.append(z)
|
||||||
wspolne.append(z1)
|
return sorted(wspolne)
|
||||||
return wspolne.sort()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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