-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdef.py
38 lines (26 loc) · 980 Bytes
/
def.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
33
34
35
36
37
38
import re
# this will be smudged when pushing to repo by smudge filter
# and cleaned when pulling from repo by clean filter
API_KEY = "{SECRET_TOKEN}"
def compare_strings(string1, string2):
# Convert both strings to lowercase
# and remove leading and trailing blanks
string1 = string1.lower().strip()
string2 = string2.lower().strip()
# Ignore punctuation
punctuation = r"[.?!,;:\-']"
string1 = re.sub(punctuation, r"", string1)
string2 = re.sub(punctuation, r"", string2)
# DEBUG CODE GOES HERE
# print(string1, string2)
return string1 == string2
print(compare_strings("Have a Great Day!", "Have a great day?")) # True
print(compare_strings("It's raining again.", "its raining, again")) # True
print(
compare_strings("Learn to count: 1, 2, 3.", "Learn to count: one, two, three.")
) # False
print(compare_strings("They found some body.", "They found somebody.")) # False
def main():
print("hi")
pass
main()