I have a list of strings like the following in Python:
SS = ['T', 'Q', 'T', 'D', 'Q', 'D', 'D', 'Q', 'T', 'D']
Is there anyway I could check how many Ts are directly followed by D, so in this case, there are 2 Ts (second and the last T) that meet the requirement.
I tried this but it was not working though, any advice? thx!
if ['T','Q'] in SS:
print ("yes")