forked from tdwojak/Python2017
commited tasks
This commit is contained in:
parent
464d765a82
commit
fe8c5810e4
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user