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
yan [13]
3 years ago
9

Write a function named remove_duplicates that takes a list (of numeric and/or string values) and returns a new list with only th

e unique elements from the original. This function assumes that there is at least 1 element in the list and that the list does not contain any sublists. The original list is not modified in any way. The returned list does not have to preserve the order of the original list.
Computers and Technology
1 answer:
Lorico [155]3 years ago
6 0

Answer:

def remove_duplicates(lst):

   no_duplicate = []

   dup = []

   for x in lst:

       if x not in no_duplicate:

           no_duplicate.append(x)

       else:

           dup.append(x)

   for y in dup:

       if y in no_duplicate:

           no_duplicate.remove(y)

   return no_duplicate

Explanation:

Create a function called remove_duplicates that takes one parameter, lst

Create two lists one for no duplicate elements and one for duplicate elements

Create for loop that iterates through the lst. If an element is reached for first time, put it to the no_duplicate. If it is reached more than once, put it to the dup.

When the first loop is done, create another for loop that iterates through the dup. If one element in no_duplicate is in the dup, that means it is a duplicate, remove that element from the no_duplicate.

When the second loop is done, return the no_duplicate

You might be interested in
What is a Slide Master?
mafiozo [28]

The correct answer is c. the default design template in a presentation program for Plato. Hope this helps :)

8 0
3 years ago
Read 2 more answers
Which principle of CSR requires that a business state facts fully and accurately?
DaniilM [7]

Answer: transparency

Explanation:

3 0
3 years ago
A user input is when the user interacts with the program by typing.<br> True<br> False
Yuri [45]
The answer is true I think
6 0
3 years ago
Read 2 more answers
How is a UDP socket fully identified? What about a TCP socket? What is the difference between the full identification of both so
vekshin1

Answer:

Following are the solution to this question:

Explanation:

Two tuples were fully identified only with UDP socket.:

< IP address assigned, the port for destination >

Its two tuples have been used in UDP as demux, buttons to identify its UDP socket.

The IP address for the destination:

Its received data is directly provided by the IP address of its port.

Port number of the destination:

The function of the IP address of its port number whenever you obtain a UDP segment would be to control the IP addresses of a segment or send that segment to a port with the same IP address. Its port number for endpoint allows demultiplexing incoming information from its IP.

TCP socket is completely recognized by the following four tuples:

< source IP, port source, IP source, port location >

It tuples are being used to label the sockets by using a demultiplexing (demux) key.

IP address source:

The IP address is being used to identify the unique host that links to. It can assume that perhaps the source IP address shows us all the source Addresses of the sender.

Port number of source:

Its port number amount allows us to identify which section is arriving at which port.

IP address destination:

Its IP address of a destination is the IP address of a port accepting incoming information.

Port number of the destination:

It is port numbers number allows us to identify the facilities or section should be sent to.

Differentiation between TCP and UDP identifier:  

As TCP ports (4 tuples) and UDP ports (2 tuples) are using demux keys to define socks, however, demux keys in UDP are unique from others in TCP for both the following reasons:

TCP uses a separate socket for every contact between both the server and client whereas UDP utilizes its same sockets to process all clients accessed by UDP servers with all communications, it maintains TCP is much more dependable and hence has to hold a different port.

Even so, UDP doesn't accomplish things apart from multicasting and demodulation, but no separate port is necessary by each link. Therefore the TCP socket becomes connection-driven as well as the UDP socket is direct link-free.

5 0
3 years ago
1. Open command prompt
icang [17]

Answer:

What do you want me to do

Explanation:

3 0
3 years ago
Other questions:
  • the ____ presents information about the document, the progress of current tasks, and the status of certain commands and keys.​
    14·1 answer
  • Riodic Table
    6·1 answer
  • Why is the following statement true - ideally, your information is abbreviated
    10·2 answers
  • What does the binary odometer show about representing large numbers?
    8·1 answer
  • Careers in information technology deal with
    12·2 answers
  • ICD-10-CM diagnosis codes are entered in Block 21 of the CMS-1500 claim. A maximum of __________ ICD-10- CM codes may be entered
    14·1 answer
  • Maria wants to create an image for a Web page. Maria should use _____. help me
    8·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    7·2 answers
  • Why is it a good idea to restate in your own words what you heard someone say? It can reduce the chances of a miscommunication.
    11·1 answer
  • HELP ASAP IF YOU KNOW PYTHON 2!!!
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!