Question: This Code is in Python Keywords: break and continue are not allowed. Global variables are not allowed. If you do not know what that means,
This Code is in Python

Keywords: break and continue are not allowed. Global variables are not allowed. If you do not know what that means, for now, interpret this to mean that inside of your functions you can only use variables that are created in that function. For example, this is not allowed, since variable x is not a parameter of function a_times(a) nor is it a variable created in function a_times(a). It is a global variable created outside of all functions. def a_times(a): result=x*a return result x=float(input("Give me a number: ")) print(a_times(10))
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) 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
Get step-by-step solutions from verified subject matter experts
