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
Vikki [24]
2 years ago
15

Write a program that will ask the user for a set of ten numbers. After all ten numbers have been entered, the program will displ

ay the largest and smallest numbers of the data set. The program will then prompt the user whether he/she would like to enter another set of data. When the user indicates he/she is finished entering data sets, the program will finally display the average largest number and the average smallest number for all sets entered.
Computers and Technology
1 answer:
muminat2 years ago
8 0

Answer:

In Python:

nums = []

larg= []

small = []

while True:

   for i in range(10):

       num = int(input(": "))

       nums.append(num)

   print("Smallest: "+str(min(nums))); print("Largest: "+str(max(nums)))

   larg.append(max(nums))

   small.append(min(nums))

   another = int(input("Press 1 to for another sets: "))

   nums.clear()

   if not another == 1:

       break

   

print("Average Large: "+str(sum(larg)/len(larg)))

print("Average Small: "+str(sum(small)/len(small)))

Explanation:

This initializes the list of input numbers

nums = []

This initializes the list of largest number of each input set

larg= []

This initializes the list of smallest number of each input set

small = []

This loop is repeated until, it is exited by the user

while True:

The following iteration is repeated 10 times

   for i in range(10):

Prompt the user for input

       num = int(input(": "))

Add input to list

       nums.append(num)

Check and print the smallest using min; Check and print the largest using max;

   print("Smallest: "+str(min(nums))); print("Largest: "+str(max(nums)))

Append the largest to larg list

   larg.append(max(nums))

Append the smallest to small list

   small.append(min(nums))

Prompt the user to enter another set of inputs

   another = int(input("Press 1 to for another sets: "))

Clear the input list

   nums.clear()

If user inputs anything other than 1, the loop is exited

<em>    if not another == 1:</em>

<em>        break</em>

Calculate and print the average of the set of large numbers using sum and len    

print("Average Large: "+str(sum(larg)/len(larg)))

Calculate and print the average of the set of smallest numbers using sum and len

print("Average Small: "+str(sum(small)/len(small)))

You might be interested in
Consider the following code:
ICE Princess25 [194]

Answer: 3

Explanation:

Because X = 18 and our condition given to the code if > and < which do not match with the input so it prints 3.

4 0
3 years ago
What keyboard combination can you use to open the windows tool context menu, which contains options such as power options and di
Shkiper50 [21]
Windows button and x
8 0
3 years ago
What is the main advantage of Ram<br><br>​
andre [41]

Answer:

to get milk

Explanation:

gjvuvuvjvvjvjvvjvjvhvjvub

7 0
3 years ago
Hey plz help me with this<br>What is malware short for?​
soldier1979 [14.2K]

Answer:

Malware is the collective name for a number of malicious software variants, including viruses, ransomware and spyware. Shorthand for malicious software, malware typically consists of code developed by cyberattackers.

Explanation:

4 0
2 years ago
Give two examples of html structure
butalik [34]

Answer:

semantic information that tells a browser how to display a page and mark up the content within a document

7 0
2 years ago
Other questions:
  • when you cross or enter traffic from a full stop, how much space should you allow on city streets? on the highway?
    11·1 answer
  • If you want an app to reach the largest possible audience, which two platforms should you use?
    7·1 answer
  • The software used to help run the computer hardware is the _____.
    15·2 answers
  • What does the headgear of a mine do
    6·2 answers
  • 4. In this problem, we consider sending real-time voice from Host A to Host B over a packet-switchednetwork (VoIP). Host A conve
    14·1 answer
  • Write a program in python to test if given number is prime or not.
    6·2 answers
  • The 60-watt light bulb has a 400 hour life expectency how much will it cost to operate during its time
    14·1 answer
  • I CANT DO SKIN MODS ON BRAWLHALLA RIGHT!!!! IM SO MADDDDDDDDDDD
    11·1 answer
  • Which programming paradigm does the programming language JavaScript follow?
    14·1 answer
  • HELP ASAP Encoding a video format and then decoding it during playback is one of the functions of MPEG-4 and H.264 file players.
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!