Question: PYTHON 3.X enter a list of positive numbers ( terminate by 0 ) into an array. Without using a sort find the largest number in
PYTHON 3.X
enter a list of positive numbers (terminate by 0) into an array. Without using a sort find the largest number in the array, and output the result. Create and use:
a function to input the numbers and make sure they are integers,
a function to find the largest number (write your own function, don't use the python max or sort functions), and
a function to output the result.
example Interaction (the red text is not part of the output):
Please input a list of integers. To finish entering the integers, input a "0" for the value. Please input an integer < 0 to finish >: 4 Please input an integer < 0 to finish >: 6 Please input an integer < 0 to finish >: 54 Please input an integer < 0 to finish >: 87 Please input an integer < 0 to finish >: 12 Please input an integer < 0 to finish >: 1.5 (NOTE: not a valid input) I was expecting an integer number, please try again... Please input an integer < 0 to finish >: 8 Please input an integer < 0 to finish >: asdf (NOTE: not a valid input) I was expecting an integer number, please try again... Please input an integer < 0 to finish >: 98 Please input an integer < 0 to finish >: 0 The maximum value is: 98
Step by Step Solution
There are 3 Steps involved in it
To solve the task of finding the largest number in a list of positive integers terminated by zero well break it down into steps Here is a clear stepby... View full answer
Get step-by-step solutions from verified subject matter experts
