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
Discovery of a vulnerability in a software program can potentially be sold to the government. Group of answer choices True False
enyata [817]

Discovery of any vulnerability in a software program can potentially be sold to the government: True.

<h3>What is vulnerability?</h3>

Vulnerability is any form of weakness, flaw or defect that is found in a software application, computer system, or network, which can be exploited by an attacker (hacker), in order to gain an unauthorized access and privileges to sensitive user data that are stored in a computer system.

This ultimately implies that, a vulnerability in a software application can potentially be sold to the government, so as to avert and mitigate any form of unauthorized access and privileges to sensitive user data.

Read more on vulnerability here: brainly.com/question/25813524

#SPJ1

4 0
1 year ago
You can pin applications to which two areas?
mrs_skeptik [129]

Answer:

A and C.

Explanation:

The taskbar and the Start are both shortcuts to use when opening applications. The taskbar is at the bottom of your computer or pc. And the start can be opened by pressing the windows key or clicking on windows at the bottom right (Windows only.)

Hope that helps!

5 0
3 years ago
I WILL GIVE BRAINLIST THING TO WHOEVER GIVES ME THE CORRECT ANSWER
Anna11 [10]

Answer:

Evaluate and compare free and commercial versions of the antivirus software provided at the link above. Based on the information you learned in this Unit, what differences, if any, are significant enough to warrant considering paying for the software versus using the free version (for a typical home user, if the specific annual costs were not a major consideration)? What is “missing” from the personal/home/base level subscription that you might want?

Explanation:

4 0
2 years ago
Which of the following is an example of a Boolean operator?
miv72 [106K]

Answer:

C. But

Explanation:

Boolean operators are the operators that may have only two outputs which are True/False, On/Off and 1/0.

"But" can also be the example of Boolean operator. It is used in the meaning of "except" or "other than".

In Boolean operators "But" can be used as "AND" operator.

for example

<em>I am busy but I will go.</em>

In above example but is used as and which is combining two oposite statements. as

I am busy  and I will go.

Both statement oppose each other, so to make sense in English "But" is used.

7 0
2 years ago
Assume we are using the simple model for floating-point representation as given in this book (the representation uses a 14-bit f
Artemon [7]

Answer:

The representation of 100.0 in the floating-point representation is computed as follows: First convert the given number 100.0 in the binary form. 10010 = 11001002 the binary representation.

Explanation:

3 0
2 years ago
Other questions:
  • How useful do you find the creation of folders in your computer?
    8·2 answers
  • What can you use with your keywords to narrow your search if you complete an internet search using a search engine and do not ge
    15·2 answers
  • Which of the following laptop features allows users to overcome keyboard size restrictions?
    11·1 answer
  • How do you compare text on different pages of a document?
    14·1 answer
  • A user contacted the help desk to report that the laser printer in his department is wrinkling the paper when printed. The user
    5·1 answer
  • Four differences between fourth and fifth generation of computers​
    12·1 answer
  • Please help me ASAP! Here is the question.
    15·1 answer
  • Hurry im TIMED
    8·1 answer
  • What was revolutionary about Web 2.0?
    5·1 answer
  • UPS or FedEx plays what role in the supply?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!