forked from fenyx-it-academy/Class4-PythonModule-Week1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2.Hafta-Odev4.py
More file actions
43 lines (25 loc) · 757 Bytes
/
2.Hafta-Odev4.py
File metadata and controls
43 lines (25 loc) · 757 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
strA = str(input("Kelime_1:"))
strA = strA.lower()
strB = input("Kelime_2:")
strB = strB.lower()
punctuation = "!@#$%^&*()_+<>?:.,;"
for c in strA:
if c in punctuation:
strA = strA.replace(c, "")
for c in strB:
if c in punctuation:
strB = strB.replace(c, "")
A = set(strA)
B = set(strB)
A_KES_B = list(A.intersection(B))
sorted(A_KES_B)
print("A ve B'de ortak bulunan harfler:")
print([''.join(A_KES_B)])
A_FARK_B = list(A - B)
sorted(A_FARK_B)
print("A'da olup B'de olmayan harfler:")
print([''.join(A_FARK_B)])
B_FARK_A = list(B - A)
print("B'da olup A'de olmayan harfler:")
print([''.join(B_FARK_A)])
print([''.join(A_KES_B)], [''.join(A_FARK_B)], [''.join(B_FARK_A)])