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
Vladimir79 [104]
3 years ago
6

The aim of this activity is to implement an algorithm that returns the union of elements in a collection. Although working with

sets is quick and easy in Python, sometimes we might want to find the union between two lists. Create a function called unite_lists, which uses a loop to go through both lists and return common elements. Do not use the built-in set function.
Computers and Technology
1 answer:
shusha [124]3 years ago
3 0

Answer:

The function in Python is as follows:

def unite_lists(A, B):

   union = []

   for elem in A:

       if elem in B:

           union.append(elem)

   return union

Explanation:

This defines the function

def unite_lists(A, B):

This initializes an empty list for the union list

   union = []

This iterates through list A

   for elem in A:

This checks if the item in list A is in list B

       if elem in B:

If it is present, the item is appended to the union list

           union.append(elem)

This returns the union of the two lists

   return union

You might be interested in
Read the excerpt from Act 111, scene iii of Romeo and Juliet. Which is the best paraphrase of this dialogue
Rufina [12.5K]
I think that D is the answer
8 0
3 years ago
PLEASE HELP THIS IS CONFUSING ME
Artemon [7]

Answer:

The answer is:

Yes, because Antonio clearly copied someone else's words.

Explanation:

It is still forbidden to plagiarize Wikipedia despite it being a Open-Source Data base of information. This means, unless you directly cite in a bibliography or with in-text citations, the article, the author, and everything else needed in the proper citations for the format, it is plagiarism.

3 0
2 years ago
Read 2 more answers
1. Isabella is a security support manager for a large enterprise. In a recent meeting, she was asked which of the standard netwo
arsen [322]

Answer:

A. router

Explanation:

Isabella is a security support manager for a large enterprise. In a recent meeting, she was asked which of the standard networking devices already present on the network could be configured to supplement the specific network security hardware devices that were recently purchased. The standard networking device Isabella would recommend is router.

3 0
3 years ago
Is the following statement true or false information literacy is a subset of health literacy
BARSIC [14]

the answer is false because information literacy is a whole other type. you don't need it for the structure of health literacy.                              

4 0
2 years ago
A data flow cannot go directly back to the same process it leaves. There must be at least ________ other process(es) that handle
Flauer [41]

Answer:

Answer is A. One.

Refer below.

Explanation:

A data flow cannot go directly back to the same process it leaves. There must be at least one other process that handle(s) the data flow, produce(s) some other data flow, and return(s) the original data flow to the beginning process.

3 0
3 years ago
Other questions:
  • Automotive engine cylinder heads can be made of what?
    7·1 answer
  • Which finger types the highlighted keys on a number keypad? A. Third B. First C. Pinky D. Thumb
    7·2 answers
  • What are the uses of a modem
    5·1 answer
  • 次のうち、ビジネスレターに適したフォントとポイントサイズの選択はどれですか?<br> 私を助けてください!私はあなたを最高にブランコにします!
    12·2 answers
  • Select each of the strategies you can use to be more efficient when using the Internet. using tabs creating tables creating book
    6·2 answers
  • Gigantic Life Insurance is organized as a single domain. The network manager is concerned that dividing into multiple domains to
    15·1 answer
  • How do you give brianliest
    13·1 answer
  • How to fix a light blub
    11·2 answers
  • What is the full form of the OS?​
    15·2 answers
  • You have been on the phone with a user in a remote office for 30 minutes troubleshooting their minor desktop problem. No matter
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!