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
Air expands through a turbine operating at steady state. At the inlet p1 = 150 lbf/in^2, T1 = 1400R and at the exit p2 = 14.8 lb
Paraphin [41]

Answer:

The power developed in HP is 2702.7hp

Explanation:

Given details.

P1 = 150 lbf/in^2,

T1 = 1400°R

P2 = 14.8 lbf/in^2,

T2 = 700°R

Mass flow rate m1 = m2 = m = 11 lb/s Q = -65000 Btu/h

Using air table to obtain the values for h1 and h2 at T1 and T2

h1 at T1 = 1400°R = 342.9 Btu/h

h2 at T2 = 700°R = 167.6 Btu/h

Using;

Q - W + m(h1) - m(h2) = 0

W = Q - m (h2 -h1)

W = (-65000 Btu/h ) - 11 lb/s (167.6 - 342.9) Btu/h

W = (-65000 Btu/h ) - (-1928.3) Btu/s

W = (-65000 Btu/h ) * {1hr/(60*60)s} - (-1928.3) Btu/s

W = -18.06Btu/s + 1928.3 Btu/s

W = 1910.24Btu/s

Note; Btu/s = 1.4148532hp

W = 2702.7hp

5 0
3 years ago
What financial arguments could you use to justify your proposed
Gnoma [55]

The recommendation to segregate FLTs and the workers are as follows:-1)Reputation of warehouse:- To be in the market the reputation of warehouse should be good,it can only happen when the worker of that warehouse is happy with the management looks after worker external and internal affairs. There should be two pathways one for vehicle and other for walking in which both can’t use vice versa.2)High Profitability:- When there is no incident or accident happens between the FLTs and the workers in the warehouse then off course the worker will be regular at work then there will be high profit .3)Insurance premium:- If there is zero accident happens in the ware house then there will no claim, the company will be in the profit..

7 0
3 years ago
What is the composition, in atom percent, of an alloy that consists of 4.5 wt% Pb and 95.5 wt% Sn?
jeka57 [31]

Answer: Option A is correct -- 2.6 at% Pb and 97.4 at% Sn.

Explanation:

Option A is the only correct option -- 2.6 at% Pb and 97.4 at% Sn. While option B, which is 7.6 at% Pb and 92.4 at% Sn. and option C, which is 97.4 at% Pb and 2.6 at% Sn. and option D, which is 92.4 at% Pb and 7.6 at% Sn. are wrong.

6 0
3 years ago
To revise a monthly budget, changes in which categories might need to be addressed? Check all that apply.
GREYUIT [131]

Income

amount budgeted

expenses

5 0
3 years ago
Air at T1 = 32°C, p1 = 1 bar, 50% relative humidity enters an insulated chamber operating at steady state with a mass flow rate
RUDIKE [14]

Answer:

4.5kg/min

Explanation:

Given parameters

T_1 = 32^0 C,  m_1 = 3 kg/min, T_2 = 7^0 C ,T_3 = 17^0

if we take  

The mass flow rate of the second stream = m_2(kg/min)

The mass flow rate of mixed exit stream = m_3 (kg/min)

Now from mass conservation

m_3 = m_2 + m_1

m_3 = m_2 + 3 (kg/min)

The temperature of the mixed exit stream given as

T_3m_3 = T_2m_2 +T_1m_1\\\\17 ( 3 + m_2) = 7 \times m_2 + 32 \times 3\\\\51 + 17 m_2 = 7 m_2 + 96\\\\10 m_2 = 96 - 51\\\\m_2 = 4.5 kg/min\\\\\\\\

Therefore the mass flow rate of second stream will be 4.5 kg/min.

7 0
3 years ago
Other questions:
  • You read a research study that concludes that the higher a student's self-esteem, the better he performs in school. This sort of
    5·1 answer
  • B1) 20 pts. The thickness of each of the two sheets to be resistance spot welded is 3.5 mm. It is desired to form a weld nugget
    12·1 answer
  • Unwanted resistance is being discussed.
    12·1 answer
  • What steps would you take to design an improved toothpaste container?
    12·1 answer
  • Which utility program reads an assembly language source file and produces an object file?
    6·1 answer
  • Explain why veracity, value, and visualization can also be said to apply to relational databases as well as Big Data.
    6·1 answer
  • When the rod is circular, radial lines remain straight and sections perpendicular to the axis do not warp. In this case, the str
    11·1 answer
  • Airplanes are the only way that people can take flight.<br> A. True<br> B. False
    14·2 answers
  • Which of the following addresses future implications of design and process decisions?
    5·1 answer
  • Question 8 (1 point)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!