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]
1 year 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]1 year ago
8 0
I was going to say the same but there is no point in writing it then
s344n2d4d5 [400]1 year 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
A user called to inform you that the laptop she purchased yesterday is malfunctioning and will not connect to her wireless netwo
kakasveta [241]

Answer:

You can perform the following two steps

Explanation:

  1. Have the user press the appropriate function key combination to enable the wireless radio and then attempt to connect to the wireless network (since by mistake he could have disabled it).
  2. Ask the user to turn on the laptop’s airplane mode and attempt to reconnect to the wireless network (this mode basically what it does is disable adapters and activate it will connect the Wi-Fi network).
7 0
1 year ago
Which statement below correctly differentiates between frames and bits? Frames have more information in them than bits. Frames a
9966 [12]
<span>Frames have more information in them than bits.
</span>
<span>Frames are made up of bits but not vice versa.


A bit (BInary digiT) is the basic unit of digital. It can be 0 (logical false, off) or 1 (not logical false - true, on). Four bits are in a nybble, which can have a value of 0 - 15, eight bits are in a byte which can have a value of 0 - 255. Words vary in size, they consist of multiple bytes and are generally correlated with the system's data bus/processor data width (a 64 bit system has an 8 byte word).
</span>
5 0
2 years ago
Read 2 more answers
How do many corporations most likely manage the health and safety of their employees and the workplace?
s344n2d4d5 [400]

Answer:

The answer to this question is given below in the explanation section. However the correct option is only by following OSHA's rules and regulation.

Explanation:

Corporations most likely manage the health and safety of their emoployees and workplace only by following the OSHA's rules and regulations.

Because this is standard law that requires employers to provide their employees with working conditions that are free of known dangers. The OSH Act created the Occupational Safety and Health Administration (OSHA), which sets and enforces protective workplace safety and health standards for employees.

However, other options are not correct because these options do not cover the employees' protective workplace safety and health.

4 0
1 year ago
The initial value for a number field on a record is 1. A user updated the value of the number field to 10. This action invokes a
erik [133]

Answer: b. 11

Explanation:

//The  initial value is 1

//let call the value as x

x = 1

//then the user updated the value to 10

//so now x is 10

x = 10

// and update the workflow to 11

//so now the value of x is 11

x = 11

even if the programmer print x, so the output will be 11

3 0
1 year ago
When you complete a form online with your name, address, and credit card information in order to make a purchase, you are giving
mafiozo [28]

Answer:

Structured

Explanation:

A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.

In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.

This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. These records are stored and communicated to other data user when required or needed.

A relational database can be defined as a type of database that is structured in a manner that there exists a relationship between its elements.

Hence, when a user completes a form online by providing his or her name, address, and credit card information in order to make a purchase, he or she is giving the company structured data (pre-defined and formatted to a set structure) that can be used to make up (populate) a relational database or spreadsheet.

A spreadsheet can be defined as a file or document which comprises of cells in a tabulated format (rows and columns) typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer systems.

3 0
1 year ago
Other questions:
  • Suppose the algorithms used to implement the operations at layer k is changed. how does this impact services at layers k-1 and k
    10·1 answer
  • Gabe wants to move text from one document to another document. He should _____.
    10·2 answers
  • 8. In time series, which of the following cannot be predicted? A) large increases in demand B) technological trends C) seasonal
    11·1 answer
  • 4.2.3: Basic while loop expression. Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Fol
    6·2 answers
  • Row array gameScores contains all player scores. Construct a row array highScores than contains all player scores greater than m
    15·1 answer
  • Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a n
    7·2 answers
  • Question 1 :Which type of unshielded twisted pair (UTP) cable is commonly used for 1000BASE-T Ethernet networks and is often mad
    8·1 answer
  • 7.8.1: Function pass by reference: Transforming coordinates. Define a function CoordTransform() that transforms the function's f
    6·1 answer
  • You need to design a data storage scheme for Hayseed Heaven library data system. There are several hundred thousand large data r
    8·1 answer
  • Given the macro definition and global declarations shown in the image below, provide answers to the following questions:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!