Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions