Question: Python 3 Only Problem 2. (Longest Stretch) Write a program longest_stretch.py that writes the longest contiguous sequence of equal integer values, from the sequence of

Python 3 Only

Problem 2. (Longest Stretch) Write a program longest_stretch.py that writes the longest contiguous sequence of equal integer values, from the sequence of integers read from the command line. If there are multiple stretches of the same length, the program should write the rst one.

$ python3 longest_stretch.py 1 1 2 3 4 4 4 5 5 6 6 6 7

4 4 4

$ python3 longest_stretch.py 1 1 2 3 4 4 4 5 5 6 6 6 6

6 6 6 6

$ python3 longest_stretch.py 1 1 2 3 4 4 4 5 5 6 6 6 6 7

6 6 6 6

$ python3 longest_stretch.py 1 2 3 4 5

1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!