I basically want to count how many times "H" printed back to back 3 times in this random sequence. How can i add a code which detects its occurence, is it possible with index method?
import random
prob= ["H","T"]
streakcount=0
x =[]
for excount in range(1000):
y = random.choice(prob)
x.append(y)
print(x)