Question: As mentioned, a run is a sequence of consecutive repeated values. Implement a Python function called longest_run that takes a list of numbers and returns

As mentioned, a run is a sequence of consecutive repeated values. Implement a Python function called longest_run that takes a list of numbers and returns the length of the longest run. For example in the sequence: 2, 7, 4, 4, 2, 5, 2, 5, 10, 12 the longest run has length 4. Then, in the main, your program should ask the user to input the list, then it should call longest_run function, and print the result. You can obtain a list of numbers from the user as explained in Question1. Five examples of program runs: Please input a list of numbers separated by space: 1 12 3.03 33365 Please input a list of numbers separated by space: 66 71111 4.5 Please input a list of numbers separated by space: 6 2.4486 Please input a list of numbers separated by space:3 Please input a list of numbers separated by space: Function call example: longest run (16, 6, 7, 1.0, 1.0, 1.0, 1, 4.5,1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
