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 URN (include example)
BARSIC [14]

Answer: URN(Uniform Resource Name) is the basically a subset of the Uniform Resource identifier(URL). It uses "urn"scheme for the working an implementation. Uniform resource name functions by identifying components uniquely through their name.

The most common example of URN is ISBN (International Standard Book Number)number which helps in the unique searching and identification of book.

7 0
3 years ago
You have a computer that runs on a windows 10 operating system and supports modern sleep. what will happen if you close the lid
adell [148]

You have a computer that runs on the Windows 10 operating system and supports modern sleep mode what will happen if you close the computer lid is the computer will be put into sleep mode. If Modern Sleep is supported, the settings for closing the lid will be configured to trigger sleep mode.

A computer system is a basic, complete and functional arrangement of hardware and software with everything needed to implement computing performance. That is the basic working definition of a computer system as we know it, but computer systems have gone through many formal changes over the last few decades.

The physical components of a computer can also be interpreted as hardware. This includes the keyboard, mouse, monitor and processor. Hardware consists of input devices and output devices that make up a complete computer system. Examples of input devices are keyboards, optical scanners, mice and joysticks that are used to enter data into a computer.

You can learn more about computer system here brainly.com/question/14583494

#SPJ4

7 0
1 year ago
This is gonna be very long but I have no idea what to do, I'm confused.
kaheart [24]

for such experiment, you do it with care and to acquire and determine to put experience in it

Explanation:

because without you been or using experience the experiment will not correct

8 0
3 years ago
What is a lan adapter
ryzh [129]

Answer:

A LAN adapter is an expansion board that is used to connect a computer or computing device to a network. LAN adapter is the most common and generic alternate name for a Network Interface Card (NIC).

4 0
3 years ago
Read 2 more answers
What is the purpose of the fit to size feature in Word?
Olegator [25]

Answer : computer

Explanation:

please mark me as brilliant

3 0
3 years ago
Other questions:
  • Explain what might happen if two stations are accidentally assigned the same hardware address?
    15·1 answer
  • Your network has had long power outages that have caused Hyper-V servers to shut down after the UPS battery is drained. When pow
    8·1 answer
  • Please Do Solve it guys...
    6·1 answer
  • What is an identified component of a software program that might allow a hacker or other intruder to gain entry and control of a
    10·2 answers
  • Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored
    12·1 answer
  • What is text box and label control​
    10·2 answers
  • How many countries don't uses the metric system?​
    12·2 answers
  • Two girls were born to the same mother, on the same day, at the same time, in the same month and the same year and yet they're n
    7·1 answer
  • Document accurately describes the differences between servers and computers and between local and wide area networks. Document p
    5·1 answer
  • Computer programming 5
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!