Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a python program with a loop that lets the user enter a series of numbers. The user should enter - 99 to signal the

Design a "python" program with a loop that lets the user enter a series of numbers. The user should enter - 99 to signal the end of the series. After all the numbers have been enter been entered, the program should display the largest and smallest numbers entered.

this is what i have so far

def main(): numbers = [] while True: user_input = int(raw_input("Enter a number")) if user_input == -99: break else: numbers.append(user_input) print('Largest is {}, smallest is {}'.format(max(numbers), min(numbers)))

def largest(number): largest = 0 if number > largest: largest = number return largest

def smallest(number): smallest = 10000 if number < smallest: smallest = number return smallest

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

=+Could you use an ambient ad?

Answered: 1 week ago