Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 3 : Name your program Lab 1 1 _ ex 3 _ Id . py Write a program that reads values from the keyboard

Exercise 3: Name your program Lab11_ex3_Id.py
Write a program that reads values from the keyboard and store them in a list. The program should then find the largest size of consecutive occurrence of the same number in the list. Output the list, the number and, the largest consecutive occurrence of the number. (If many numbers have an equal
2
consecutive occurrence then the number having the largest occurrence will be the leftmost one.) If you run your program with the following input data: 1234224445.
Your output should be as follows.
List: 1,2,3,4,2,2,4,4,4,5
The number is: 4
The largest size of consecutive numbers: 3
Your program should have at least these 3 functions:
main(): displays the list, the number and the largest consecutive occurrence
readData():reads data from the keyboard into a list
findLargestConsecutiveOccurence(): takes the list of numbers and returns the number with the largest consecutive occurrence and the number of occurrence
image text in transcribed

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions