answer.
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
N76
1 month ago
6

The top 3 most popular male names of 2017 are Oliver, Declan, and Henry according to babynames. Write a program that modifies th

e male_names set by removing a name and adding a different name. Sample output with inputs: 'Oliver' 'Atlas' { 'Atlas', 'Declan', 'Henry' } NOTE: Because sets are unordered, the order in which the names in male_names appear may differ from above.
Engineering
1 answer:
Viktor [230]1 month ago
7 0

Answer:

The Python code is provided below with suitable comments

Explanation:

# convert list to set

male_names = set(['Oliver','Declan','Henry'])

# get name for removal and addition from user

remove_name = input("Enter remove name: ")

add_name = input("Enter add name: ")

# remove specified name from set

male_names.remove(remove_name)

# add new name to set

male_names.add(add_name)

# sort the resulting set

a = sorted(male_names)

# output the sorted set

print(a)

You might be interested in
Write cout statements with stream manipulators that perform the following:
grin007 [219]

Answer:

A)cout<<setw(9)<<fixed<<setprecision(2)<<34.789;

B)cout<<setw(5)<<fixed<<setprecision(3)<<7.0;

C)cout<<fixed<<5.789E12;

D)cout<<left<<setw(7)<<67;

Explanation:

Stream Manipulators are special functions for use with the insertion (<<) and extraction (>>) operators on C++ stream objects, while the 'cout' statement outputs content to the standard output device in C++ programming.

setw: specifies the minimum width of the output field

setprecision: defines the number of decimal places for floating-point value formatting.

fixed: sets the format flag for floating-point streams.

left: left-aligns the output.

A) This statement shows the number 34.789 in a field that provides eight character spaces with two decimal precision. cout<<setw(9)<<fixed<<setprecision(2)<<34.789;

B) Here, the number 7.0 is displayed within six spaces with three decimal precision. cout<<setw(5)<<fixed<<setprecision(3)<<7.0;

C) This command prints 5.789e+12 in fixed-point format.  cout<<fixed<<5.789E12;

D) This statement left-aligns the number 67 across a field of six spaces. cout<<left<<setw(7)<<67;

7 0
23 days ago
The rate of flow of water in a pump installation is 60.6 kg/s. The intake static gage is 1.22 m below the pump centreline and re
mote1985 [204]

Answer:

The power of the pump is 23.09 kW.

Explanation:

Parameters

gravitational constant, g = 9.81 m/s^2

mass flow rate, \dot{m} = 60.6 kg/s

flow density, \rho = 1000 kg/m^3

efficiency of the pump, \eta = 0.74

output gauge pressure, p_o = 344.75 kPa

input gauge pressure, p_i = 68.95 kPa

cross-sectional area of output pipe, A_o = 0.069 m^2

cross-sectional area of input pipe, A_i = 0.093 m^2

height of discharge, z_o = 1.22 m - 0.61 m = 0.61 m (evaluated at pump’s maximum height of 1.22 m)

input height, z_i = 0 m

hydraulic power of the pump,P =? kW

Initially, the volumetric flow (Q) needs to be determined

Q = \frac{\dot{m}}{\rho}

Q = \frac{60.6 kg/s}{1000 kg/m^3}

Q = 0.0606 m^3/s

Next, compute the velocity (v) for both input and output

v_o = \frac{Q}{A_o}

v_o = \frac{0.0606 m^3/s}{0.069 m^2}

v_o = 0.88 m/s

v_i = \frac{Q}{A_i}

v_i = \frac{0.0606 m^3/s}{0.093 m^2}

v_i = 0.65 m/s

Subsequently, the total head (H) can be calculated

H = (z_o - z_i) + \frac{v_o^2 - v_i^2}{2 \, g} + \frac{p_o - p_i}{\rho \, g}

H = (0.61 m - 0 m) + \frac{{0.88 m/s}^2 - {0.65 m/s}^2}{2 \, 9.81 m/s^2} + \frac{(344.75 Pa-68.95 Pa)\times 10^3}{1000 kg/m^3 \, 9.81 m/s^2}

H = 28.74m

Finally, the computation of pump power is done as follows

P = \frac{Q \, \rho \, g \, H}{\eta}

P = \frac{0.0606 m^3/s \, 1000 kg/m^3 \, 9.81 m/s^2 \, 28.74m}{0.74}

P = 23.09 kW

6 0
25 days ago
A piece of corroded metal alloy plate was found in a submerged ocean vessel. It was estimated that the original area of the plat
Mrrafil [253]

Answer:

t = 5.27 years

Explanation:

Firstly, the corrosion penetration rate is defined by the formula;

CPR = (KW)/(ρAt)

Where;

K = constant based on exposed area A.

W - mass lost over time

t- duration

ρ - density

A - area exposed

From the problem, we have;

W = 7.6kg or 7.6 x 10^(6) mg

CPR = 4 mm/yr

ρ = 4.5 g/cm³

Area = 800 cm²

K is a constant valued at 87.6cm

Rearranging the CPR formula to isolate t, we derive;

t = KW/(ρA(CPR))

t = (87.6 x 7.6 x 10^(6))/(4.5 x 800 x 4) = 46233.3 hours

The duration in question needs to be expressed in years.

Thus, converting hours to years;

There are 8760 hours in a year.

Therefore;

t = 46233.3/8760 = 5.27 years.

8 0
4 days ago
1. You do not need to remove the lead weights inside tires before recycling them.
Kisachek [217]
That's correct -.-.-.-.-.-.-.-.-.-.-.-.-.- Easy.
7 0
1 month ago
3/63 A 2‐kg sphere S is being moved in a vertical plane by a robotic arm. When the angle θ is 30°, the angular velocity of the a
Kisachek [217]

Answer:

Ps=19.62N

Explanation:

A thorough explanation of the answer can be found in the attached files.

5 0
29 days ago
Other questions:
  • On a given day, a barometer at the base of the Washington Monument reads 29.97 in. of mercury. What would the barometer reading
    6·1 answer
  • A rod is 2m long at temperature of 10oC. Find the expansion of the rod, when the temperature is raised to 80oC. If this expansio
    7·1 answer
  • You are working in a lab where RC circuits are used to delay the initiation of a process. One particular experiment involves an
    13·1 answer
  • Current density is given in cylindrical coordinates as J = −106z1.5az A/m2 in the region 0 ≤ rho ≤ 20 µm; for rho ≥ 20 µm, J = 0
    13·1 answer
  • Number pattern Write a recursive method called print Pattern() to output the following number pattern. Given a positive integer
    8·2 answers
  • A pitfall cited in Section 1.10 is expecting to improve the overall performance of a computer by improving only one aspect of th
    6·1 answer
  • 6. You are evaluating flow through an airway. The current flow rate is 10 liters per minute with a fixed driving pressure (P1) o
    5·1 answer
  • At a certain elevation, the pilot of a balloon has a mass of 120 lb and a weight of 119 lbf. What is the local acceleration of g
    6·1 answer
  • Let Deterministic Quicksort be the non-randomized Quicksort which takes the first element as a pivot, using the partition routin
    13·1 answer
  • 4.68 Steam enters a turbine in a vapor power plant operating at steady state at 560°C, 80 bar, and exits as a saturated vapor at
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!