1
0
forked from tdwojak/Python2017

commited tasks

This commit is contained in:
s45150 2017-11-26 23:15:50 +01:00
parent 464d765a82
commit fe8c5810e4

View File

@ -9,9 +9,21 @@ Oba napisy będą składać się wyłacznie z małych liter.
""" """
def common_chars(string1, string2): def common_chars(string1, string2):
print string1 string1=''.join(sorted(string1))
print string2 string1 = string1.strip(' ')
pass #print string1
string2 = ''.join(sorted(string2))
string2 = string2.strip(' ')
#print string2
slist = list()
for char in string1:
count=string2.count(char)
if count > 0:
if char not in slist:
slist.append(char)
#print(slist)
return(slist)
def tests(f): def tests(f):