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 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 22.06.2019 19:50
Write a car class having two private member variables called tank and speed. write public methods called pumpgas and gofast. the method pumpgas gets an integer for gas that must be pumped. that value needs to be added to tank (no more than 20 gallons). it must return the amount of gas that is purchased ($4 per gallon). the method gofast should increase the speed by 5 each time it is called.write a constructor for the above class that initialized both variables to zero.write a tostring to display both the tank and speed when the car is printed.modify the car class to implement the interface comparable and an interface called carinter having the public methods in carinter.write the main program to create an array of size 5 of type car. create 5 car objects having each location of the array to refer to one of the cars. test the pumpgas, gofast, equals method on the array items. write an enhanced loop to print all the car values (using a tostring written last time).write a generic method to find the minimum of four items. pass int, double, char, string and car objects to test this method.
Answers: 1
question
Computers and Technology, 23.06.2019 01:10
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
What is a scenario where records stored in a computer frequently need to be checked
Answers: 2
You know the right answer?
Import re def compare_strings (string1, string2):
#Convert both strings to lowercase
#an...
Questions
question
English, 08.09.2021 19:40
question
Mathematics, 08.09.2021 19:40
question
Mathematics, 08.09.2021 19:40
question
Mathematics, 08.09.2021 19:40
Questions on the website: 13722367