answer.
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]
2 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]2 years ago
8 0
I was going to say the same but there is no point in writing it then
s344n2d4d5 [400]2 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
I am doing keyboarding keyboarding is very boring and yeah
Bingel [31]

Answer:

yes I agree with you

Explanation:

I have been keyboarding for the past 7 hours.

7 0
2 years ago
Read 2 more answers
You learned that properly edited resumes are necessary for making a good impression on a university or a potential employer. Dis
Daniel [21]

Answer:

it will not be a good impression and it will be hard to look for a job

Explanation:

3 0
2 years ago
When you connect to an unsecured wireless network, what might dishonest or unscrupulous computer users try to do?
loris [4]

Answer:

Hackers can snoop on data sent over your network.

Hackers can use your network to access your computer's files and system information.

Explanation: Unsecured Wireless connections are wireless connections which are have no passwords they are open to the general public,such networks can be very risky to use as it gives easy access to dishonest persons who can manipulate that opportunity to SNOOP ON DATA SENT OVER YOUR NETWORKS. They can use this hacking to fraudulently steal from your bank account and obtain your private information.

8 0
2 years ago
Open "Wireshark", then use the "File" menu and the "Open" command to open the file "Exercise One.pcap". You should see 26 packet
murzikaleks [220]
Idk idk idk idk idk idk
8 0
2 years ago
Annabeth has been using a public cloud to store and access her documents. Which drawback of a public cloud should she be aware o
Flura [38]

<u><em>i just to the test on Plato and it said that A. accessibility is wrong  the correct answer is d  security #homeschoolrocks</em></u>

5 0
2 years ago
Other questions:
  • Which process is used to protect transmitted data in a vpn?
    12·1 answer
  • Allows you to manually add an entry to the arp cache that resolves the ip address inetaddr to the physical address etheraddr. wh
    13·1 answer
  • Picture an expensive item you’d LOVE to own. What would make you happier: Buying it NOW using credit/taking out a loan? Buying i
    9·1 answer
  • Dillard’s wants to learn about its consumers' attitudes toward online purchases. There are numerous studies that are available a
    9·1 answer
  • What happened if the offshore team members are not able to participate in the iterations demo due to timezone/infrastructure iss
    12·1 answer
  • Write a method called justFirstAndLast that takes a single String name and returns a new String that is only the first and last
    9·1 answer
  • Which bus slot provides highest video performance​
    10·1 answer
  • What are ways to enter a formula in Excel? Check all that apply. Click on the Function Library group and select a function from
    10·2 answers
  • The Coins class was created to hold all your loose change, kind of like a piggy bank! For this exercise, you are going to simula
    15·1 answer
  • Given positive integer n, write a for loop that outputs the even numbers from n down to 0. If n is odd, start with the next lowe
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!