Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this code is in python 1.3 Question 3: (10 points) As mentioned, a run is a sequence of consecutive repeated values. Implement a Python function
this code is in python
1.3 Question 3: (10 points) 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, 5, 5, 5, 5, 6, 20, 1 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 1 2 3.0 3 3 3365 Please input a list of numbers separated by space: 66 711 1 14.5 Please input a list of numbers separated by space: 6 2.4 486 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, 11)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