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
In Mandatory Access Control sensitivity labels attached to object contain what information?
larisa86 [58]

Answer:b)The item’s classification and category set

Explanation: Mandatory access control(MAC) is the security component in the computer system. It is regarding the controlling the access of the operating system by the administrator.The accessing is made limited by the MAC according to the sensitivity of the data .

The authorization for user to access the system is based on this sensitivity level known sensitivity label. The objects contain the information regarding the classification and categories or level of items. Thus, the correct option is option(b).

7 0
3 years ago
) What does sampling mean?
lubasha [3.4K]
In terms of music taking one song and incorporating it into your own song
6 0
3 years ago
How many numbers can be represented with 2,3,4,8 bits?
MrRa [10]
Image that a bit is the smallest measure in programming, such as an elementary particle in physics. So, a bit can only fit one number.
5 0
3 years ago
When people become more dependent on digital technology in their lives, the potential for data misuse will grow. Explain the abo
natta225 [31]

Answer:

yest that's correct.

Explanation:

for example we can see Artificial intelligence/AI the more it becomes super computer the future of human existence will be in jeopardy like in the movie Terminator.

some people will become lazy and don't use their brain for anything

7 0
2 years ago
Write a for loop that prints the integers 50 through 1, each on a separate line. use no variables other than count.
Anton [14]
For( count = 50; count > 0; count-- )
    System.out.println( count );
5 0
3 years ago
Other questions:
  • The _____ icon looks like a clipboard with a page of paper attached. Cut Copy Paste Clipboard
    5·1 answer
  • Assume that processor refers to an object that provides a void method named process that takes no arguments. As it happens, the
    5·1 answer
  • What is the local portion of the e-mail address below? <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="
    14·1 answer
  • Which note-taking method quickly captures and organizes information?
    9·2 answers
  • Do the police check your mobile device during police checks?
    10·2 answers
  • A python keyword______.
    6·1 answer
  • Why might you receive a tax refund from the irs
    6·1 answer
  • Question 6 of 10
    11·1 answer
  • Que es tarjeta madre resumen porfa
    13·2 answers
  • Anyone from qls<br><br>or grax here<br><br>in bs​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!