Question: Create a Python function called sequenceDeTrois which takes a string and returns True if there is at least a sequence of 3 consecutive equal characters,

Create a Python function called sequenceDeTrois which takes a string and returns True if there is at least a sequence of 3 consecutive equal characters, and False otherwise. Make sure that the function is efficient: it must stop as soon as the result is known (as soon as 3 consecutive characters with the same value have been found). Don't forget to add the contract type in comments.

Step by Step Solution

3.40 Rating (172 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Below is a Python function called sequenceDeTrois that takes a string as input and returns True if t... View full answer

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 Programming Questions!