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
aleksley [76]
3 years ago
7

Write a Python program that allows the user to enter any number of non-negative floating-point values. The user terminates the i

nput list with any negative value. The program then prints the sum, average (arithmetic mean), maximum, and minimum of the values entered. Algorithm: Get all positive numbers from the user Terminate the list of numbers when user enters a negative
Computers and Technology
1 answer:
ale4655 [162]3 years ago
7 0

Answer:

The program in Python is as follows:

nums = []

isum = 0

num = int(input("Num: "))

while num >= 0:

   isum+=num

   nums.append(num)

   num = int(input("Num: "))

   

print("Sum: ",isum)

print("Average: ",isum/len(nums))

print("Minimum: ",min(nums))

print("Maximum: ",max(nums))

Explanation:

My solution uses list to answer the question

This initializes an empty list, num

nums = []

This initializes the sum of the input to 0

isum = 0

This prompts the user for input

num = int(input("Num: "))

The loop is repeated until the user enters a negative number

while num >= 0:

This calculates the sum of the list

   isum+=num

This appends the input to the list

   nums.append(num)

This prompts the user for another input

   num = int(input("Num: "))

   

This prints the sum of the list

print("Sum: ",isum)

This prints the average of the list

print("Average: ",isum/len(nums))

This prints the minimum of the list

print("Minimum: ",min(nums))

This prints the maximum of the list

print("Maximum: ",max(nums))

You might be interested in
Touchdowns were worth 7 points. Braydenand Gavin scored 7 touchdowns. Cole andFreddy's team scored 9 touchdowns. Howmany more PO
Lubov Fominskaja [6]

Answer:

14 points

Explanation:

Touchdowns are worth 7 points

Since Brayden and Gavin scored 7 touchdowns, they will have 7 * 7 = 49 points

Since Cole and Freddy scored 9 touchdowns, they will have 9 * 7 = 63 points

Cole and Freddy have 63 - 49 = 14 more points than Brayden and Gavin.

7 0
4 years ago
A large software development company employs 100 computer programmers. Of them, 45 areproficient in Java, 30 in C, 20 in Python,
melisa1 [442]

Answer:

18, 13, 19

Explanation:

Number of computer programmers proficient only in Java = 45 - ( 1+1+6) = 37

Number of computer programmers proficient only in C++ = 30 - (6+1+5) = 18

Number of computer programmers proficient only in python = 20 - ( 1+1+5) = 13

Number of computer programmers are not proficient in any of these three languages = 100 - ( 37 + 18 + 13 + 1+ 1+ 5+ 6 ) = 100 - 81 = 19

4 0
3 years ago
6.3.6: Adding to a Value codehs<br> help i don't know what to do .
QveST [7]

Question:

Write a function that adds together all values from 0 to a given value and returns the final number. For example, if the given value is `4`, you would add 0 + 1 + 2 + 3 + 4

Answer:

In Python:

def add_to_value(n):

   sum = 0

   for i in range(n+1):

       sum = sum + i

   

   return sum

Explanation:

This line defines the function

def add_to_value(n):

This line initializes sum to 0

   sum = 0

The following iteration adds from 0 to n

<em>    for i in range(n+1):</em>

<em>        sum = sum + i</em>

   

This line returns the calculated sum

   return sum

4 0
3 years ago
The resistance in a particular kind of circuit is found using this formula: R1(R2)R1+R2.
jenyasd209 [6]

Answer:

resistance = (R1 * R2) / (R1 + R2)

Explanation:

PYTHON doesn't recognize multiplication like this example >> 3(4)

This is why PYTHON uses this symbol (*)

3 0
3 years ago
Free wifi is typically offered on an <br> a) unencrypted<br> b) encrypted<br> c) open<br> d) private
aliya0001 [1]

c) open

I think this because when you're in an open space (such as starbucks) it's public for anyone to enter. I think.

7 0
3 years ago
Read 2 more answers
Other questions:
  • 125 • 12² what is the answer?<br>- 124​
    6·1 answer
  • What does the hexadecimal number 2D represent in the binary system?
    9·1 answer
  • Each brochure template produces _____ pages of graphics, business information text boxes, and story boxes.
    15·1 answer
  • As a chemical engineer, what would you be most likely to do in your job?
    15·1 answer
  • While you work on the customer’s printer, he continues chatting about his network and problems he’s been experiencing. One compl
    14·2 answers
  • Which of the following is the best name for a history report about World War I?
    7·2 answers
  • In their legacy system. Universal Containers has a monthly accounts receivable report that compiles data from Accounts, Contacts
    6·1 answer
  • Give two reasons you should be aware of your computer's system components and their characteristics.
    10·1 answer
  • Analyze the map below and answer the question that follows. A topographic map of Northwestern Russia. Areas on the map are circl
    13·2 answers
  • What is difference between reserved and user defined word
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!