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
Assuming your computer only has one network card installed; explain how your virtual machine is able to share that card with you
adell [148]

Answer and Explanation:

Virtual machine have one imitated organize connector and there is one of a kind MAC address is allocated with it.  

The system driver of the Virtual machine's performs all the task:  

  • The system driver places physical connector in 'promiscuous' mode implies physical connector will acknowledge all system parcel paying little heed to MAC address,then virtual machine's driver channels its bundles and direct it to the virtual machine.
5 0
3 years ago
Which software-development methodology would be best if an organization needed to develop a software tool for a small group of u
xxTIMURxx [149]
I think prototyping model is best
3 0
3 years ago
Complete the following sentences with the correct form of the verbs in brackets.
Rina8888 [55]

Answer:

1. don't pass, will be

2. will get, eat

3. don't help, won't help

4. are meeting, will you go?

5. will stay, rains

Is

6.Will

Puts on

7.Will go

Asks

8.Will... tell

9.Tell

Will

10.Go... Will find out...

Explanation:

5 0
3 years ago
My brainly is no hello friend , i need you can you help me, please okay
Pachacha [2.7K]

Answer:

I'll try to help you!

what do you need?

Explanation:

I hope you have an amazing day!

✧◝(⁰▿⁰)◜✧

8 0
2 years ago
Read 2 more answers
What is the effect of this line of CSS code?
Semenov [28]
The correct answer is C
6 0
3 years ago
Other questions:
  • An output device is any device that displays, prints, or plays content stored on a computer. from the list below, identify the d
    14·1 answer
  • In internet terminology, what is the term, .com, called?
    12·2 answers
  • Define and test a function myRange. This function should behave like Python’s standard range function, with the required and opt
    11·2 answers
  • DeShawn uses Google Ads. He wants to enable website call conversion tracking so he can see how his current ad campaign is drivin
    12·1 answer
  • Which of the following is true about images that are arranged in a collumn
    9·1 answer
  • What is it called to persist in trying to multitask can result in this; the scattering bits of one’s attention among a number of
    9·1 answer
  • You are a database administrator. Chantelle comes to you asking for help on how to access all the data in one row of the databas
    11·1 answer
  • How to interchange first half of the array with second half of array in python?
    9·1 answer
  • How much does a dodge tomohawk cost for a used one?
    7·1 answer
  • Cuáles eran las condiciones de vida de las mujeres durante el renacimiento perduran​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!