forked from fenyx-it-academy/Class7-Python-Module-Week2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhw_2w_answer3.py
More file actions
49 lines (29 loc) · 756 Bytes
/
hw_2w_answer3.py
File metadata and controls
49 lines (29 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
st1 = list(input("\nPlease put the first word: "))
st2 = list(input("\nPlease put the second word: "))
if " " in st1:
st1.remove(" ")
elif " " in st2:
st2.remove(" ")
st1 = set(st1)
st2 = set(st2)
my_set ={}
def mtw (st):
my_set = sorted(st1.intersection(st2)) # asp
nl= [' '] * 3
print()
for i in ((my_set)):
nl[0] = nl[0] + i
if nl[0] == " ":
nl[0] = "No match"
my_set = sorted(st1.difference(st2)) # hr
for i in ((my_set)):
nl[1] = nl[1] + i
if nl[1] == " ":
nl[1] = "No match"
my_set = sorted(st2.difference(st1))
for i in ((my_set)):
nl[2] = nl[2] + i
if nl[2] == " ":
nl[2] = "No match"
print(nl, '\n')
mtw(my_set)