-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest3.py
More file actions
29 lines (28 loc) · 1.05 KB
/
test3.py
File metadata and controls
29 lines (28 loc) · 1.05 KB
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
def is_werewolf(target: str) -> bool:
# write your code her
if not target:
return True
else:
if target[0] == " " or target[0] == "?" or target[0] == "," or target[len(target) - 1] == " " or target[len(target) - 1] == "?" or target[len(target) - 1] == ",":
decrypt = ""
else:
decrypt = target[len(target) - 1]
target2 = ""
for char in range(len(target) - 1, 0, -1):
if target[char - 1] == " " or target[char - 1] == "?" or target[char - 1] == ",":
pass
else:
decrypt = decrypt + target[char - 1]
# print(decrypt)
for char in range(1, len(target) + 1):
if target[char - 1] == " " or target[char - 1] == "?" or target[char - 1] == ",":
pass
else:
target2 = target2 + target[char - 1]
print(target2.lower())
print(decrypt.lower())
if decrypt.lower() == target2.lower():
return True
else:
return False
pass