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]
3 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]3 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
If you are setting up a race car. What is the cross weight? Does it matter?
lara31 [8.8K]

Answer:

cross-weight is used to tighten it up.

Explanation:

and yes this is important because Cross-weight percentage compares the diagonal weight totals to the car's total weight.

hope  this help

(mark this answer as an brainliest answer)

7 0
3 years ago
What is the basic formula for actual mechanical advantage?
slavikrds [6]

Answer:

Mechanical Advantage Formula

The efficiency of a machine is equal to the ratio of its output to its input. It is also equal to the ratio of the actual and theoretical MAs. But, it does not mean that low-efficiency machines are of limited use. An automobile jack, for example, have to overcome a great deal of friction and therefore it has low efficiency. But still, it is extremely valuable because small effort can be applied to lift a great weight.

Also, in another way the mechanical advantage is the force generated by a machine to the force applied to it which is applied in assessing the performance of the machine.

The mechanical advantage formula is:

MA = FBFA

Explanation:

MAmechanical advantageFBthe force of the object

FAthe effort to overcome the force

3 0
3 years ago
Find E[x] when x is sum of two fair dice?
Ksenya-84 [330]

Answer:

When two fair dice are rolled, 6×6=36 observations are obtained.

P(X=2)=P(1,1)=

36

1

​

P(X=3)=P(1,2)+P(2,1)=

36

2

​

=

18

1

​

P(X=4)=P(1,3)+P(2,2)+P(3,1)=

36

3

​

=

12

1

​

P(X=5)=P(1,4)+P(2,3)+P(3,2)+P(4,1)=

36

4

​

=

9

1

​

P(X=6)=P(1,5)+P(2,4)+P(3,3)+P(4,2)+P(5,1)=

36

5

​

P(X=7)=P(1,6)+P(2,5)+P(3,4)+P(4,3)+P(5,2)+P(6,1)=

36

6

​

=

6

1

​

P(X=8)=P(2,6)+P(3,5)+P(4,4)+P(5,3)+P(6,2)=

36

5

​

P(X=9)=P(3,6)+P(4,5)+P(5,4)+P(6,3)=

36

4

​

=

9

1

​

P(X=10)=P(4,6)+P(5,5)+P(6,4)=

36

3

​

=

12

1

​

P(X=11)=P(5,6)+P(6,5)=

36

2

​

=

18

1

​

P(X=12)=P(6,6)=

36

1

​

Therefore, the required probability distribution is as follows.

Then, E(X)=∑X

i

​

⋅P(X

i

​

)

=2×

36

1

​

+3×

18

1

​

+4×

12

1

​

+5×

9

1

​

+6×

36

5

​

+7×

6

1

​

+8×

36

5

​

+9×

9

1

​

+10×

12

1

​

+11×

18

1

​

+12×

36

1

​

=

18

1

​

+

6

1

​

+

3

1

​

+

9

5

​

+

6

5

​

+

6

7

​

+

9

10

​

+1+

6

5

​

+

18

11

​

+

3

1

​

=7

E(X

2

)=∑X

i

2

​

⋅P(X

i

​

)

=4×

36

1

​

+9×

18

1

​

+16×

12

1

​

+25×

9

1

​

+36×

36

5

​

+49×

6

1

​

+64×

36

5

​

+81×

9

1

​

+100×

12

1

​

+121×

18

1

​

+144×

36

1

​

=

9

1

​

+

2

1

​

+

3

4

​

+

9

25

​

+5+

6

49

​

+

9

80

​

+9+

3

25

​

+

18

121

​

+4

=

18

987

​

=

6

329

​

=54.833

Then, Var(X)=E(X

2

)−[E(X)]

2

=54.833−(7)

2

=54.833−49

=5.833

∴ Standard deviation =

Var(X)

​

=

5.833

​

=2.415

4 0
2 years ago
A compound sliding miter saw can be used to make
Sunny_sXe [5.5K]

Answer:

D

Explanation:

3 0
2 years ago
Water vapor at 10bar, 360°C enters a turbine operatingat steady state with a volumetric flow rate of 0.8m3/s and expandsadiabati
Artyom0805 [142]

Answer:

A) W' = 178.568 KW

B) ΔS = 2.6367 KW/k

C) η = 0.3

Explanation:

We are given;

Temperature at state 1;T1 = 360 °C

Temperature at state 2;T2 = 160 °C

Pressure at state 1;P1 = 10 bar

Pressure at State 2;P2 = 1 bar

Volumetric flow rate;V' = 0.8 m³/s

A) From table A-6 attached and by interpolation at temperature of 360°C and Pressure of 10 bar, we have;

Specific volume;v1 = 0.287322 m³/kg

Mass flow rate of water vapour at turbine is defined by the formula;

m' = V'/v1

So; m' = 0.8/0.287322

m' = 2.784 kg/s

Now, From table A-6 attached and by interpolation at state 1 with temperature of 360°C and Pressure of 10 bar, we have;

Specific enthalpy;h1 = 3179.46 KJ/kg

Now, From table A-6 attached and by interpolation at state 2 with temperature of 160°C and Pressure of 1 bar, we have;

Specific enthalpy;h2 = 3115.32 KJ/kg

Now, since stray heat transfer is neglected at turbine, we have;

-W' = m'[(h2 - h1) + ((V2)² - (V1)²)/2 + g(z2 - z1)]

Potential and kinetic energy can be neglected and so we have;

-W' = m'(h2 - h1)

Plugging in relevant values, the work of the turbine is;

W' = -2.784(3115.32 - 3179.46)

W' = 178.568 KW

B) Still From table A-6 attached and by interpolation at state 1 with temperature of 360°C and Pressure of 10 bar, we have;

Specific entropy: s1 = 7.3357 KJ/Kg.k

Still from table A-6 attached and by interpolation at state 2 with temperature of 160°C and Pressure of 1 bar, we have;

Specific entropy; s2 = 8.2828 KJ/kg.k

The amount of entropy produced is defined by;

ΔS = m'(s2 - s1)

ΔS = 2.784(8.2828 - 7.3357)

ΔS = 2.6367 KW/k

C) Still from table A-6 attached and by interpolation at state 2 with s2 = s2s = 8.2828 KJ/kg.k and Pressure of 1 bar, we have;

h2s = 2966.14 KJ/Kg

Energy equation for turbine at ideal process is defined as;

Q' - W' = m'[(h2 - h1) + ((V2)² - (V1)²)/2 + g(z2 - z1)]

Again, Potential and kinetic energy can be neglected and so we have;

-W' = m'(h2s - h1)

W' = -2.784(2966.14 - 3179.46)

W' = 593.88 KW

the isentropic turbine efficiency is defined as;

η = W_actual/W_ideal

η = 178.568/593.88 = 0.3

8 0
3 years ago
Other questions:
  • Water vapor at 6 MPa, 500°C enters a turbine operating at steady state and expands to 20 kPa. The mass flow rate is 3 kg/s, and
    8·1 answer
  • How has drafting evolved in the 21st century
    10·1 answer
  • Show from the first principles that, for a perfect gas with constant specific heat capacities
    14·1 answer
  • Which of the following is true Select one: a. HTML stands for Hyper Text Markup Language is a language for describing web pages
    6·1 answer
  • A 4-pole, 3-phase induction motor operates from a supply whose frequency is 60 Hz. calculate: 1- the speed at which the magnetic
    10·1 answer
  • A person is interested in becoming an electrician. What are some appropriate types of preparation that this individual can consi
    7·2 answers
  • Which of the following describes a product concept?
    15·1 answer
  • A column carries 5400 pounds of load and is supported on a spread footing. The footing rests on coarse sand. Design the smallest
    10·1 answer
  • (a) calculate the moment at point "c", where point "c" is the square 3'' below the centroid
    13·1 answer
  • I need help with this question
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!