Question: i need help fixing this python code We'll say that a triple in a string is a character that appears three times in a row.

 i need help fixing this python code We'll say that ai need help fixing this python code

We'll say that a triple in a string is a character that appears three times in a row. Triples may overlap. For example, the string "AAAXBBBBxyz' contains three triples. Write code that counts the number of triples in a string named text and stores the result in a variable named triple_count. Assume that the variable text already has a value. prev char count + 1 if (prev_char_count >= 3): triple_count + 1 else: prev_char count = 1 prevoius_char = text[index] 13 print(triple count) Check My Solution Load My Latest Solution [Reset Test Results: You're using a variable named triple_count. The result is correct for the string 'abcdef". X The result is not correct for the string 'zzz'. The result is not correct for the string 'xxxx'. * The result is not correct for the string 'abcXXXdefYYYghizzzjki'. X The result is not correct for the string 'tttttttttttt

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!