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
Get step-by-step solutions from verified subject matter experts
