Answer the question
In order to leave comments, you need to log in
How to find if there are consecutive elements in a list?
Hello, there is such an array
a = ['p', 'p', 'p', 'p', 'p', 'p', 'figure', 'h2', 'figure', 'p', 'p', 'p', 'p', 'p', 'p']
Answer the question
In order to leave comments, you need to log in
a = ['p', 'p', 'p', 'p', 'p', 'p', 'figure', 'h2', 'figure', 'p', 'p', 'p', 'p', 'p', 'p']
''.join(['p', 'figure', 'h2', 'figure']) in ''.join(a)
True
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question