forked from tdwojak/Python2018
zrobiono zadanie 11
This commit is contained in:
parent
7f4577f327
commit
1a4de39386
@ -9,7 +9,12 @@ Oba napisy będą składać się wyłacznie z małych liter.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def common_chars(string1, string2):
|
def common_chars(string1, string2):
|
||||||
pass
|
s1 = string1.replace(' ','')
|
||||||
|
s2 = string2.replace(' ','')
|
||||||
|
s1=set(s1)
|
||||||
|
s2=set(s2)
|
||||||
|
common = s1 & s2
|
||||||
|
return(sorted(list(common)))
|
||||||
|
|
||||||
|
|
||||||
def tests(f):
|
def tests(f):
|
||||||
@ -23,4 +28,4 @@ def tests(f):
|
|||||||
return "TESTS PASSED"
|
return "TESTS PASSED"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(tests(common_chars))
|
print(tests(common_chars))
|
Loading…
Reference in New Issue
Block a user