Question: 3. (3 pts) Use Python to write a function that takes a single input, a list of numbers. The function should loop through the
3. (3 pts) Use Python to write a function that takes a single input, a list of numbers. The function should loop through the list and, on each iteration, print the number if it is the largest number the function has seen from the list so far, or tied for being the largest number. In particular, the first number should always be printed, the second number is only printed if it is greater than or equal to the first number, the third is only printed if it is greater than or equal to both the first and second number, and so on. The list passed to the function could be of any length. As an example, when passed the list [4,2,7,6,9,10,3,2], the output would look like: 7 419 10
Step by Step Solution
There are 3 Steps involved in it
Algorithm 1 Function Definition Define a function named printlargestnumberssofar that takes a single ... View full answer
Get step-by-step solutions from verified subject matter experts
