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
lianna [129]
3 years ago
5

Prompt the user to enter four numbers, each corresponding to a person's weight in pounds. Store all weights in a list. Output th

e list. (2 pts)
Ex:

Enter weight 1:
236.0
Enter weight 2:
89.5
Enter weight 3:
176.0
Enter weight 4:
166.3
Weights: [236.0, 89.5, 176.0, 166.3]
(2) Output the average of the list's elements with two digits after the decimal point. Hint: Use a conversion specifier to output with a certain number of digits after the decimal point. (1 pt)

(3) Output the max list element with two digits after the decimal point. (1 pt)
Computers and Technology
1 answer:
Lesechka [4]3 years ago
6 0

Answer:

# FIXME (1): Prompt for four weights. Add all weights to a list. Output list.

weight_one=float(input('Enter weight 1:\n'))

weight_two=float(input('Enter weight 2:\n'))

weight_three=float(input('Enter weight 3:\n'))

weight_four=float(input('Enter weight 4:\n'))

weights=[weight_one,weight_two,weight_three,weight_four]

print(weights)

# FIXME (2): Output average of weights.

average_weight=(weight_one + weight_two + weight_three + weight_four) / 4

print('Average weight:', "%.2f" % average_weight)

# FIXME (3): Output max weight from list.

weights.sort()

max_weight= weights[3]

print('Max weight:', "%.2f" % max_weight)

# FIXME (4): Prompt the user for a list index and output that weight in pounds and kilograms.

print(input('Enter a list index location (0 - 3):'))

print('Weight in pounds:', weights)

kilograms = float(weights) * 2.2

print('Weight in kilograms:')

# FIXME (5): Sort the list and output it.

weights.sort()

print(weights)

Explanation:

You might be interested in
Again, suppose that n and r denote integer values where r > 0 and n ≥ 0. What are two "simple" values, say lowEnough and tooH
enyata [817]

Answer:

Answer explained

Explanation:

From the previous question we know that while searching for n^(1/r) we don't have to look for guesses less than 0 and greater than n. Because for less than 0 it will be an imaginary number and for rth root of a non negative number can never be greater than itself. Hence lowEnough = 0 and tooHigh = n.

we need to find 5th root of 47226. The computation of root is costlier than computing power of a number. Therefore, we will look for a number whose 5th power is 47226. lowEnough = 0 and tooHigh = 47226 + 1. Question that should be asked on each step would be "Is 5th power of number < 47227?" we will stop when we find a number whose 5th power is 47226.

6 0
3 years ago
The advantage of an electronic ____ is that the content can be easily edited and updated to reflect changing financial condition
Lana71 [14]
Computer.................................
6 0
3 years ago
Change the function definition for myint so that xyzfunc uses the same memory locations for myint as in the calling program.
sattari [20]

Answer:

b) void xyzfunc (int &myint);

Explanation:

To use the same memory location as the variable in the calling function we have to pass the variable by reference means passing the same address to the function.So to do that we have use & operator which stands for address.

We will do this as following:-

void xyzfunc (int * myint);

Hence the answer is option b.

8 0
3 years ago
Which best describes an advantage of creating a contact group?
Lapatulllka [165]
More than one contact can be added to the group at a time.
8 0
3 years ago
You can enter the following things in cells
katrin [286]

Answer:

You enter three types of data in cells: labels, values, and formulas.

Explanation:

I hope this is the right answer I knew it on top of my head but I made sure with goggle to.

3 0
2 years ago
Other questions:
  • How i can connect to internet automatically when i switch on my computer?
    8·1 answer
  • How can I make my Wi-Fi signal fast? I am going through my exam but my Wi-Fi is not supporting plz help.
    12·1 answer
  • A firewall, when properly implemented, can prevent most attacks on your system.
    11·1 answer
  • What information on social networking sites could be used to discriminate against a potential employee
    9·1 answer
  • ____ devices are high-performance storage systems that are connected individually to a network to provide storage for the comput
    12·1 answer
  • "Managers and department heads across the nation strategize on a weekly, if not daily, basis. For the past three quarters, telep
    6·1 answer
  • Int a=10 int b=20<br> A=b<br> The new values for a and b are
    11·2 answers
  • @anthonydboss23<br><br> it’s goldielove6 <br><br> .....this is not a question everyone ignore this
    11·2 answers
  • Which type of security software prevents, detects, and removes the malware program that tries to collect personal information or
    8·2 answers
  • A microsoft windows os component responsible for representing graphical objects and transmitting them to output devices such as
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!