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

Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print o

ut the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number. Enter 7, 2, bob, 10, and 4 and match the output below.
Computers and Technology
1 answer:
bearhunter [10]3 years ago
6 0

A program that repeatedly prompts a user for integer numbers :

biggest = none

smallest = none

while True:

input = raw_input(“Enter a number:”)

if(input == “done” break

try:

 number = float(inp)

 except ValueError:

 print “Please enter only numbers”

else

 if smallest is None:

  smallest = number;

  biggest = number;

elif number < smallest:

 smallest = number

elif num > largest:

 largest = number

Print “Greatest is “, biggest

Print “Smallest is”, smallest

In this program an input is obtained, if it is equal to the word “done”, then the program stops b printing greatest and smallest number in the given input.

If invalid inputs are given then user is prompted to enter valid number. Otherwise the value of smallest and greatest are calculated according to the input using if-else construct.

You might be interested in
How can i do a back up on one computer and save it to the hard drive in another computer without it being seen by others on the
Ganezh [65]
Unless you share the backup HD only the local user is going to see it. Given that it's a server, it's not a problem. You can also hide the backup with attributes +h +s and many other ways.
8 0
3 years ago
Decrypt this message: P ht uva h zwf
KatRina [158]
Translation: I am a spy
5 0
3 years ago
I need help making a survey for highschool students in my school any topics/questions?
givi [52]

Answer:

depends is it just a survey? because if it doesent matter about the questions ou can do basic quuestions such as "what is your favorite video games" or "what is your favorite food"?

Explanation:

4 0
3 years ago
What are the home row keys?
kramer
ASDF JKL; are the home row keys.
7 0
3 years ago
Universal Containers has a requirement to integrate Salesforce with an external system to control record access.
Alenkasestr [34]

Answer:

C.  Use the SOAP API to maintain the related SObject_share records

Explanation:

In order to ensure that Universal Containers have complete control over the system, the company needs to use certain requirements. This is to ensure that non-authorized persons do not have any access to the information. Based on the information provided in the question, the correct option is option C.

3 0
3 years ago
Other questions:
  • Emma wants to create a web page for her school’s volleyball team. Which of these could she use?
    7·1 answer
  • A(n) ____ tag is used to let the compiler know that your intention is to override a method in a parent class
    10·1 answer
  • Which is an example of static web page??
    9·2 answers
  • Your customer, Mykel, is ordering a custom-built computer for his home office and isn’t sure which components should be the high
    12·1 answer
  • Rerouting traffic using arp poisoning is an attack on ________ of a network.
    8·1 answer
  • When you purchase donuts, they come in boxes of 12, so 24 donuts take 2 boxes. All donuts need to be in a box, so if you buy 13
    10·1 answer
  • Assume the user responds with a 3 for the first number and a 4 for the second number.
    13·1 answer
  • What are input masks most useful for in data validation? moving data from one field to another hiding parts of a value that are
    9·2 answers
  • With which feature or menu option of a word processing program can you make an image like this?
    14·2 answers
  • To delete unnecessary files on a hard disk use software
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!