-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWord List.py
32 lines (27 loc) · 954 Bytes
/
Word List.py
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
def Function(Array):
SearchIndex = Array[0]
SearchChar = [i for i in Array[1:]]
CopyString = SearchIndex
Output = []
Return = ""
i = 1
while True:
i += 1
try:
if len(str(CopyString).removesuffix(SearchChar[-i])) != len(CopyString):
CopyString = str(CopyString).removesuffix(SearchChar[-i]).strip()
Output.append(str(SearchChar[-i]).strip())
SearchChar.pop(-i)
i = 1
if len(CopyString) == 0:
break
except:
print("Kelime Tanımlanmamış.")
break
for i in range(1, len(Output) + 1):
Return += Output[-i]
print(f"Output : {str(Return)}")
print(Output)
Function(
["HastaneOrmanPatatesKöftesi", "tesi", "OrmanPata", "manKı", "taneOr", "tesKöf", "Bil", "Ama", "Hastanse", "Amaz",
"zon", "da", "Bilgi"])