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
Sleeping is an effect of _______ , but agitation may cause a person to wake up
Crank
"Sleeping is an effect of <span>Depressants, but agitation may cause a person to wake up"</span><span />
4 0
3 years ago
Read 2 more answers
Why are variables useful in programming?
levacccp [35]
Variables can be useful because they hold a certain number/data value that can easily be accessed and changed. For example, in a game, a players score is a variable that changes as the player gets more points; ie coins, items, etc.

4 0
3 years ago
Read 2 more answers
___________ is a mass-produced, copyrighted software that meets the needs of a wide variety of users, not just a single user or
GaryK [48]

Answer: Package software

Explanation:

Packaged software is the software that contains the functions and programs that are similar in the nature and features.

It is designed in such a way so that it can attract the customers and user by providing the benefit of the selling of the collection of programs rather than buying individual software programs which costs higher.

Thus, it produced at a large scale as well as bought by numerous users.

4 0
3 years ago
Camera lenses typically have very long focal points. true or false.
Alisiya [41]
No, it is false. This is mainly because there would be no need.
8 0
3 years ago
Read 2 more answers
What two Python data structures are already thread-safe, because they provide automatic support for synchronizing multiple reade
murzikaleks [220]

The  two Python data structures that are already thread-safe are list and tuples.

<h3>What are the data structures in Python?</h3>

Python is known to give room for its users to make  their own Data Structures.

It helps one to be able to  have total hold or control over their work or output functionality. Some key Data Structures are Stack, Queue, and others.

Learn more about Python from

brainly.com/question/26497128

#SJ1

6 0
2 years ago
Other questions:
  • Regulatory control limits the activities of an organization in compliance with the organization's policies. True False
    14·2 answers
  • Shakespeare’s complete works have approximately 3.5 million characters. Which is bigger in file size: Shakespeare’s complete wor
    5·2 answers
  • Help !!!!!
    9·1 answer
  • What can be said about the equipment used by photographers during the Civil War?
    13·2 answers
  • A speaker takes a variety of information from the results of a web search, and puts it together in an outline to make up his spe
    8·1 answer
  • ​Microsoft claims that the microsoft project software can _____.
    11·1 answer
  • Cora is writing a program to make a motorcycle racing game. If Cora wants the speed of the motorcycle to appear on the screen wh
    5·2 answers
  • Who addicted to fnaf
    5·2 answers
  • During the data transmission there are chances that the data bits in the frame might get corrupted. This will require the sender
    8·1 answer
  • What are different social phenomenas are you aware of that used part of a social movement, change, or cause
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!