subject

Import re 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(_)
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
Run
print(compare_strings ("Learn to count: 1, 2, 3.", "Learn to count: one, two, three."); # Fa
Reset
print(compare_strings ("They found some body.", "They found somebody.")) # False

can someone please help. don't answer, just help me please, someone tell me where I can start and how without letting me know the answer. I know its probably cheating, but a girl just needs some help. my first computer classes are I've done good so far, but this is just too hard

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
What are some ways to use a range name in a formula? check all that apply. in the defined names group, click use in formula, and then select the desired name. begin typing the name in the formula, select a name from the autocomplete list, and use the arrow keys and tab key to enter the name in the formula. begin typing the formula, and then click and drag with the mouse to select the cells to include in the formula. right-click one of the cells in the range. click formula options, and use the dialog box to add the name.
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Under the home tab, where can a user find options to change the bullet style of an outline? in the slides group in the font group in the paragraph group in the drawing group
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
In the rgb model, which color is formed by combining the constituent colors? a) black b) brown c) yellow d) white e) blue
Answers: 1
You know the right answer?
Import re def compare_strings (string1, string2):
#Convert both strings to lowercase
#an...
Questions
question
Mathematics, 06.01.2020 05:31
question
Mathematics, 06.01.2020 05:31
question
Mathematics, 06.01.2020 05:31
question
Mathematics, 06.01.2020 05:31
Questions on the website: 13722367