Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started