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 with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions