subject

Write a python 3 function named words_in_both that takes two strings as parameters and returns a set of only those words that appear in both strings. You can assume all characters are letters or spaces. Capitalization shouldn't matter: "to", "To", "tO", and "TO" should all count as the same word. The words in the set should be all lower-case. For example, if one string contains "To", and the other string contains "TO", then the set should contain "to". 1.Use python's set intersection operator in your code.
2.Use Python's split() function, which breaks up a string into a list of strings. For example:

sentence = 'Not the comfy chair!'
print(sentence. split())
['Not', 'the', 'comfy', 'chair!']
Here's one simple example of how words_in_both() might be used:

common_words = words_in_both("She is a jack of all trades", 'Jack was tallest of all')

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 04:31
Selling a product through an electronic medium is
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
What makes myhexadecimalnumber a child of mynumber? which methods does myhexadecimalnumber inherit directly from the mynumber class? what can an instance of the mynumber class do? what can an instance of the myhexadecimalnumber class do? which methods are overridden? why are they overridden? how many examples of overloading are there? why was this done? where is the super keyword used? what is it doing? why isn’t the incoming value set immediately in the second myhexadecimalnumber constructor? how many examples can you find of an inherited method being called?
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
What shows the web address of the page that is currently displayed in the workspace? status window toolbar location bar internet box
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
When writing a business letter, how many times can you use the same merge field in a document? once once, unless using the address block feature unlimited it will depend on the type of document you choose
Answers: 1
You know the right answer?
Write a python 3 function named words_in_both that takes two strings as parameters and returns a set...
Questions
question
Mathematics, 03.03.2021 18:50
question
Mathematics, 03.03.2021 18:50
question
Mathematics, 03.03.2021 18:50
Questions on the website: 13722362