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
Ronch [10]
3 years ago
10

Write a program that uses a loop to read 10 integers from the user. Each integer will be in the range from -100 to 100. After al

l 10 integers have been read, output the largest and smallest values that were entered, each on its own line in that order. If you want to best prepare yourself for the exam, avoid using the max or min functions from Python, and definitely use a loop to read the integers instead of 10 input statements. Zybooks won't stop you from doing these things, but you won't be studying the correct topics to prepare for the first exam.
Computers and Technology
1 answer:
LiRa [457]3 years ago
6 0

Answer:

// program in Python

#variables

mx=-1000

mn=1000

#read 10 values from user

for i in range(1,11):

   num=int(input("Enter the number {}:".format(i)))

   #input validation

   while num not in range(-100,100):

       num=int(input("Wrong input!! Enter again:"))

   #find maximum

   if num<mn:

       mn=num

   #find minimum

   if num>mx:

       mx=num

#print maximum

print("largest value is:",mx)

#print minimum

print("smallest value is:",mn)

Explanation:

Create variables "mx" to store maximum and "mn" to store minimum.Read 10 numbers from user.If the input number if less than -100 or greater than 100 then ask again  to enter a number between -100 to 100 only.Find the maximum and minimum from the  all 10 numbers.Print maximum and minimum values.

Output:

Enter the number 1:23                                                                                                      

Enter the number 2:-200                                                                                                    

Wrong input!! Enter again:33                                                                                              

Enter the number 3:-2                                                                                                      

Enter the number 4:45                                                                                                      

Enter the number 5:105                                                                                                    

Wrong input!! Enter again:45                                                                                              

Enter the number 6:-44                                                                                                    

Enter the number 7:-56                                                                                                    

Enter the number 8:79                                                                                                      

Enter the number 9:98                                                                                                      

Enter the number 10:4                                                                                                      

largest value is: 98                                                                                                      

smallest value is: -56  

You might be interested in
Divide the difference of 47 and 23 by the difference of 25 &amp;13​
OleMash [197]

Answer:

The answer is 2

Explanation:

3 0
3 years ago
Define quality control​
tangare [24]

Quality control is a system of maintaining standards in manufactured products by testing a sample of the output against the specification.

8 0
3 years ago
Don't click on this I am testing
Andrew [12]

Don't click on this I am testing... I want the points so.

3 0
3 years ago
Read 2 more answers
Isabela wants to edit a presentation for her science class. She is in the main view of the PowerPoint application
Karolina [17]

Answer:Click the File tab, and click the Open option.

Explanation: correct on edge

8 0
3 years ago
Traffic shaping reduces traffic by ________. preventing certain undesirable traffic from entering the network limiting the amoun
Lera25 [3.4K]

Answer:

Explanation:

Traffic Shaping is a technique for managing congestion on a network by delaying the flow of less important/desired packets on the network so more valuable/desirables ones are able to pass. Traffic shaping reduces traffic by preventing certain undesirable traffic from entering the network as well as limiting the amount of certain undesirable traffic entering the network.

5 0
3 years ago
Other questions:
  • Word 2013 opens, by default, on a blank document?
    13·2 answers
  • Select five system utility functions.
    11·1 answer
  • Write another function to convert a value to its word equivalent leveraging the following tuple - o Number = (‘One’, ‘Two’, … ‘N
    10·1 answer
  • Which statement accurately describes DTP programs?
    11·1 answer
  • Jeremy Aronoff has purchased a new laptop. He wants to customize the operating system to meet his
    7·1 answer
  • Please discuss what you consider to be some of the biggest challenges your company will face when working from the Linux command
    14·1 answer
  • How is a website most likely to distinguish its different sections?
    8·1 answer
  • HELP
    11·1 answer
  • A slide titled Alexander Graham Bell. There are 6 bulleted entries on the slide, and there is a lot of text on the slide. There
    11·2 answers
  • How to make a message appear in more than one slack channel
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!