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
Which of the following is not a shared characteristic of new media.
tensa zangetsu [6.8K]
The last one , info is not sparse or little , we have plenty of it
6 0
4 years ago
When authenticating a user's password, the password supplied by the user is authenticated by comparing the ____ of the password
Bas_tet [7]

Answer:

Hash.

Explanation:

An authentication can be defined as the process of verifying the identity of an individual or electronic device. Authentication work based on the principle (framework) of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.

Basically, authentication ensures a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification. Smart cards, digital certificates, picture passwords, and biometrics are generally used to perform an authentication in the field of computer.

Hence, when authenticating a user's password, the password supplied by the user is authenticated by comparing the hash of the password with the one stored on the system.

In Computer science, a hash function can be defined as any function which is used to map data by accepting a block of data with variable length size or arbitrary size as input to produce a fixed size hash values or codes.

Generally, when a block of data (input) of arbitrary size is hashed, the resulting hash values or codes is usually smaller than the input data. Thus, hash functions are considered to be a compression of data and as a result, sometimes called compression functions. Basically, the block size of a hash function typically ranges from 128 bits to 512 bits.

5 0
3 years ago
How many frequencies does a full-duplex qam-64 modem use?
Vsevolod [243]

The answer is 2 frequencies.

A Full-Duplex QAM 64 K Modem uses two frequencies. One frequency is used for upstream and the other for downstream. A variety of common QAM forms are available and include, 16 QAM, 32 QAM, 64 QAM, and 256 QAM. For example, for domestic broadcast use, 64 and 256 QAM are used for cable modem and digital cable TV. The modulation scheme for this modem uses both amplitude and phase.

8 0
4 years ago
Read 2 more answers
An understanding of basic psychology can help design and marketing teams ensure they meet their intended audience.
Kamila [148]

Answer:

um true i think cause to understand something or someone you have to help it to find it place in the world by make design for them and have a team to help you so they can that there audience if that help you plz mark me brainliest if not then you don't have to

Explanation:

5 0
3 years ago
Read 2 more answers
The flagging of an uncommon last name as a spelling error can be stopped by opening the shortcut menu on the first occurrence of
Mice21 [21]

Solution:

The flagging of an uncommon last name as a spelling error can be stopped by opening the shortcut menu on the first occurrence of the name and selecting of ignoring all.

Thus the required right answer is B.

8 0
3 years ago
Other questions:
  • An OS X backup utility that automatically backs up files to a dedicated drive that is always available when the computer is turn
    6·1 answer
  • Which of the following patterns of cell phone use can be observed in this chart
    12·1 answer
  • NOTE: in mathematics, division by zero is undefined. So, in C , division by zero is always an error. Given a int variable named
    10·1 answer
  • Grace Hopper led the development of ______, a programming language for business applications.
    6·2 answers
  • Plot element is typically the turning point in the most intense moment of a story
    8·1 answer
  • What type of engineer is interested in designing, developing, and building different machines, devices, and tools? A.aerospace
    8·2 answers
  • which statement is true? O A Future games will be more context oriented. OB. Future games will be more product driven. Future ga
    13·2 answers
  • Using complete sentences post a detailed response to the following.
    13·1 answer
  • _____ is rampant with bugs and shortcomings because most programmers do not know how or do not take the time to incorporate secu
    14·1 answer
  • WHO WANT P O I N T S.................................................
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!