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]
4 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]4 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
What is a protocol and what are the types of protocol​
wlad13 [49]
A protocol is a set of rules that governs the communications between computers on a network.

1. HTTP or HTTPs. This stands for Hypertext Transfer Protocol or Hypertext Transfer Protocol (secure).

2. FTP (File Transfer Protocol)

3. Email Protocols (POP3, IMAP, SMTP)

4. TCP(Transmission Control Protocol) and UDP(User Datagram Protocol)

Hoped that helped
3 0
4 years ago
Read 2 more answers
Is GLaDOS from portal 2 possible?
77julia77 [94]

Answer:

Explanation:Yes Glados 2 is posible.

8 0
4 years ago
How would you classify the earliest historical examples of STEM discoveries provided in this lesson?
Readme [11.4K]
MATHEMATICAL DISCOVERIES
4 0
4 years ago
Read 2 more answers
Write down the name of output devices
notka56 [123]

Answer:

Monitor

Printer

Headphones

Computer Speakers

Projector

GPS

Sound Card

Video card

4 0
3 years ago
Read 2 more answers
k-means is a flat, partitioning clustering technique. how can k-means be used for hierarchical clustering?
Black_prince [1.1K]

K-means can be used for hierarchical clustering by creating a hierarchical tree structure. This is done by setting the number of clusters to be created, and then running the k-means clustering algorithm for each level of the tree. For each level, the clusters created are then combined to form the next level of the tree. This process is repeated until the desired number of clusters has been created.

<h3>The Use of K-Means Clustering for Hierarchical Clustering</h3>

K-means clustering is a popular technique used in machine learning and data mining for partitioning data into clusters. It is a flat clustering algorithm, in which data points are grouped according to their similarity. While k-means clustering is suitable for partitioning data into a fixed number of clusters, it can also be used for hierarchical clustering. Hierarchical clustering is a clustering technique that creates a hierarchical tree structure, where each level of the tree is made up of clusters created by the k-means clustering algorithm.

The process of creating a hierarchical tree structure using k-means clustering is fairly straightforward. First, the number of clusters to be created is set, and then the k-means clustering algorithm is run for each level of the tree. For each level, the clusters created are then combined to form the next level of the tree until the desired number of clusters has been created. This process ensures that the clusters created are meaningful and have similar characteristics.

Learn more about k-means :

brainly.com/question/17241662

#SPJ4

3 0
2 years ago
Other questions:
  • The mutt software is an example of what type of mail service software on Linux? a. Mail Delivery Agent b. Mail Transport Agent c
    5·1 answer
  • Taylor has spent a lot of time developing and setting up his presentation. He wants to make sure his delivery is as good as poss
    8·2 answers
  • Can somebody please halp meeee?? I'm doing Web design.
    12·2 answers
  • Explain how software is distinct from hardware.
    8·2 answers
  • Number of frames displayed per second
    15·1 answer
  • Michael’s team is presenting a robot before their examiners. What do they need which is a definitive description of the final pr
    6·1 answer
  • The process of converting an input file (stream of characters) into an understandable format is called syntax analysis.
    7·1 answer
  • which feature of organisations to manage needs to know about to build and use information system successfully
    6·1 answer
  • Discuss the objectives of business 8 marks​
    10·2 answers
  • When companies charge different prices for the same product, they're using
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!