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 04:30
Which of the statements below is true? the formatting, standard, and drawing commands are unavailable. the formatting, standard, and drawing commands have been used. the formatting, standard, and drawing toolbars are displayed. the formatting, standard, and drawing toolbars are hidden.
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Which of the following terms refers to a collection of different types of software that share the goal of infiltrating a computer and making it do something? a- malware b- virus c- spyware d- trojan horse
Answers: 2
question
Computers and Technology, 24.06.2019 13:50
Write a program that performs a simple n-body simulation, called "jumping leprechauns." this simulation involves n leprechauns, numberd 1 to n. it maintains a gold value g_i for each leprechaun i, which begins with each leprechaun starting out with a million dollars worth of gold, that is, g_i = 1000000 for each i = 1,. in addition, the simulation also maintains, for each leprachaun,i, a place on the horizon, which is represented as a double-precision floating point number, x_i. in each iteration of the simulation, the simulation processes the leprachauns in order. processing a leprachaun i during its iteration begins by computing a new place on the horizon for i, which is determined by the assignment:
Answers: 3
You know the right answer?
Import re def compare_strings (string1, string2):
#Convert both strings to lowercase
#an...
Questions
question
Mathematics, 11.11.2020 14:00
question
History, 11.11.2020 14:00
question
History, 11.11.2020 14:00
question
English, 11.11.2020 14:00
question
English, 11.11.2020 14:00
Questions on the website: 13722361