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
Alex787 [66]
4 years ago
11

g (b) (4 pt) Write a function unique that identifies the repeated elements of a list and returns a list with unique elements. $

(unique (list)) () $ (unique (list 1 10 3 14)) (1 10 3 14) $ (unique (list 11 18 31 18)) (11 18 31)

Engineering
1 answer:
Taya2010 [7]4 years ago
6 0

Answer:

I am writing a Python function unique()    

def unique(list):  # function unique that takes a list as parameter

 unique_list = []  #list to store unique elements

 for elements in list:  # loop that checks every element of the list

   if elements not in unique_list:  # takes unique elements from list

     unique_list.append(elements)  

#appends unique elements  from list to unique_list

 return unique_list      #outputs unique_list elements

         

Explanation:

The unique() function takes a list as argument which is named as list.

unique_list is a new list which stores unique element from the list.

The loop moves through the elements of the list one by one.

if condition checks if the element in list is not present in the unique_list which means that element is unique to the unique_list.

If this condition is true this means that the element is not repeated and is not already present in unique_list. Then that element is included to the unique_list using append() function which appends an element into the unique_list from the list.

If you want to check if this function works you pass a list with repeated elements to this function so that it can print the unique elements as follows:

print(unique([1,2,2,2,2,3,4,4,4,4,4,5]))

Output:

[1, 2, 3, 4, 5]

The screen shot of the function along with its output is attached.

You might be interested in
This question is 100 points<br> I NEED HELP!!!
Mamont248 [21]

Answer:

hey if u repost this i can answer it u and u dont have to waste this much points but its super blury and not even able to read a single word

8 0
3 years ago
Read 2 more answers
A __________ is an added note showing additional or more specific information.
xxMikexx [17]

Answer:

awnsers should be added to know to show additional

8 0
4 years ago
what is an example of an innovative solution to an engineering problem? Explain briefly why you chose this answer.
Leviafan [203]

Answer:

robotic technology    

Explanation:

Innovation is nothing but the use of various things such as ideas, products, people to build up a solution for the benefit of the human. It can be any product or any solution which is new and can solve people's problems.

Innovation solution makes use of technology to provide and dispatch new solutions or services which is a combination of both technology and ideas.

One such example of an innovative solution we can see is the use of "Robots" in medical science or in any military operations or rescue operation.

Sometimes it is difficult for humans to do everything or go to everywhere. Thus scientist and engineers have developed many advance robots or machines using new ideas and technology to find solutions to these problems.

Using innovations and technologies, one can find solutions to many problems which is difficult for the peoples. Robots can be used in any surveillance operation or in places of radioactive surrounding where there is a danger of humans to get exposed to such threats. They are also used in medical sciences to operate and support the patient.  

3 0
3 years ago
Force = 33 newtons
kicyunya [14]

Answer:

answer

Explanation:

4 0
3 years ago
A gearbox is needed to provide an exact 30:1 increase in speed, while minimizing the
alekssr [168]

Answer:

answer

Explanation:

4 0
3 years ago
Other questions:
  • Technician A says that a magnetic field can be created by current flow. Technician B says that current can be induced by moving
    5·1 answer
  • Two technicians are discussing the intake air temperature (IAT) sensor. Technician A says that the computer uses the IAT sensor
    9·1 answer
  • In addition to bandages and gauze, it's recommended that a first aid kit also contain ___________. A) A finger splintB) Portable
    9·1 answer
  • State 2 reasons on why blind spot checks are important
    5·1 answer
  • Part of the basic procedures is the vehicle check. What does that mean?
    7·1 answer
  • The Review_c object has a lookup relationship up to the Job_Application_c object. The job_Application_c object has a master-deta
    7·1 answer
  • Item110pointseBook HintPrintReferences Check my work Check My Work button is now disabled5Item 1Item 1 10 pointsAn ideal Diesel
    10·1 answer
  • Do you know who Candice is
    8·2 answers
  • Technician A says that fuel filler caps with pressure and vacuum vents are used with EVAP system fuel tanks. Technician B says t
    5·1 answer
  • Explain wet and dry compression tests​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!