1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kenny6666 [7]
3 years ago
7

Write a python 3 function named words_in_both that takes two strings as parameters and returns a set of only those words that ap

pear 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')
Computers and Technology
2 answers:
mrs_skeptik [129]3 years ago
8 0
I was going to say the same but there is no point in writing it then
s344n2d4d5 [400]3 years ago
5 0

Answer:

def words_in_both(a, b):

 a1 = set(a.lower().split())

 b1 = set(b.lower().split())

 return a1.intersection(b1)

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

print(common_words)

Explanation:

Output:

{'all', 'of', 'jack'}

You might be interested in
Would you buy a 2017 SYM WOLF CLASSIC 150 for $2,999?<br><br> Just wondering.
Anika [276]

seeing that its a 2017 it sounds pretty good.... as long as thats really what you want ( you should totally just get a dirt bike lol)

3 0
2 years ago
When would it be necessary to shoot in 4K according to the presentation?
Nataly_w [17]

Answer:

because it provides you a lot of storage and the post production equipment to handle it and it is used to do big projects

Explanation:

so l know this much it is correct please mark me brainllest

6 0
2 years ago
When resizing images or objects in a presentation, why should a user not utilize the sizing handles in the middle of the sides
Shalnov [3]

When resizing an image or an object in a presentation, a user should not utilize the sizing handles in the middle of the sides or the bottom of the image. There's nothing wrong with resizing this way.

There's nothing wrong with resizing this way

<u>Explanation:</u>

When the sizing handles in the middle of the sides are used, the image stretches out reflecting an increase in the width maintaining There's nothing wrong with resizing this way.

On the other hand, while using the sizing handles at the bottom, the image increases in height whilst maintaining the same width again disturbing the aspect ratio.

5 0
2 years ago
Read 2 more answers
Multimedia computer system required the following hardware component they are what​
Lady bird [3.3K]
To develop the system of multimedia we use the various hardware/softwarecomponents are:

The CPU: The CPU, which

is recommended for a multimedia computer should be Pentium IV or other advanced chips. The Monitor: The multimedia PC should be equipped with a monitorhaving Super

Video Graphics Arrays (SVGA) card.

Mark me as brainliest please
3 0
2 years ago
When a linked chain contains nodes that reference both the next node and the previous node, it is called a(n)?
Nuetrik [128]

Doubly linked chain

When a linked chain contains nodes that reference both the next node and the previous node, it is called a doubly linked chain. This type of chain is often used in data structures because it provides a way to easily traverse the data in both directions. However, because each node must reference both the next node and the previous node, doubly linked chains require more memory than singly linked chains.

Learn more here:

brainly.com/question/13100699

#SPJ4

6 0
1 year ago
Other questions:
  • In 2-3 paragraphs, identify at least two ways technology and innovation have affected global economic competition. Provide a spe
    5·1 answer
  • On sites that use "cloud computing," how is your information being stored?
    13·1 answer
  • To change the size of a field or record by dragging its border a.resize b.magnify c.label d.enlarge
    11·2 answers
  • Given six memory partitions of 100 MB, 170 MB, 40 MB, 205 MB, 300 MB, and 185 MB (in order), how would the first-fit, best-fit,
    10·1 answer
  • What can you do to help create a safe online environment?
    8·2 answers
  • Is the Internet dangerous?
    10·2 answers
  • Which is a good example of kinetic energy
    14·2 answers
  • which scheduling algorithm allocate the CPU firt to the process that request the CPU first, (a) first come first serve,(b) short
    9·1 answer
  • Assume variable age = 22, pet = "dog", and pet_name = "Gerald".
    6·1 answer
  • As of 2019, approximately how much of the world population actively access the internet?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!