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
Mr. Stevens is the principal of a high school. Why might he want to export data from a database of students’ exam scores?
Anna007 [38]

I am not sure but I think that it is either the First option or the Third option but you would probably need more information.

7 0
2 years ago
Read 2 more answers
In this exercise, first run the code as it is given to see the intended output. Then trace through each of the 3 variables to se
dlinn [17]

Answer:

The memory with variable names str1, str2, and str3 all have equal and the same value after the first if-statement.

Explanation:

The str1 was first assigned a null value while the str2 and str3 were assigned the string value "Karen" with the String class and directly respectively. On the first if-statement, the condition checks if the str1 is null and assigns the value of the variable str2 to str1, then the other conditional statement compares the values of all the string variables.

3 0
3 years ago
Type the correct answer in the box. Spell all words correctly. Complete the sentence below that describes an open standard in vi
Anika [276]

Answer:

digital

Explanation:

Today, video production has become digital, and all playback devices work on the open standard known as digital technology.​

8 0
3 years ago
Suppose you can access the caches in the local DNS servers of your department. Can you propose a way to roughly determine the We
lubasha [3.4K]

Answer:

We can periodically take a snapshot of the Domain Name System (DNS) caches in the local  Domain Name System (DNS) servers.

Explanation:

We can periodically take a snapshot of the Domain Name System (DNS) caches in the local  Domain Name System (DNS) servers. The Web server that appears most frequently in the  Domain Name System (DNS) caches is the most popular server. This is because if more users are interested in a Web server, then Domain Name System (DNS) requests for that server are more frequently sent by users. Thus, that Web server will appear in the  Domain Name System (DNS) caches more frequently.  

6 0
3 years ago
15 points: Which type of system is used to capture and leverage the decision-making abilities of human experts?
salantis [7]

Answer:

A

Explanation:

4 0
2 years ago
Other questions:
  • If you have a list of words that you wish me to make into a bulleted list, you must first highlig or ______ The words with the c
    13·1 answer
  • To add color to the entire background of a page, users will select the ___ feature?
    14·1 answer
  • Which term refers to a type of an attack in which an attacker makes his data look like it is coming from a different source addr
    10·1 answer
  • In basic network scanning, ICMP Echo Requests (type 8) are sent to host computers from the attacker, who waits for which type of
    14·1 answer
  • The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09
    11·1 answer
  • Use the word bank to identify each description.
    6·1 answer
  • How to play Drinkopoly game?
    12·1 answer
  • Im drinking coffee. and working on school and watching a show. Whos with me?
    9·1 answer
  • HELP MEEE PLEASE!!!
    11·1 answer
  • The ____ file is typically saved with a prefix of inc_.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!