I guess that the first part of your code is just to initialize the sample data.
Then here are a few things:
- Separate initialization and main loop. I know this is just an exercise, but always doing it will help you keep the mindset.
- If you only need to count something, just count it. Don't keep track of everything.
- If you only need to check the existence of something, use a boolean value and return as soon as you've found it. Adding elements to a list so that at the end you can count them and return a boolean based on the count is definitely not an efficient way to do it.
- What you call
cursor is actually an integer, not an object, so the name
index may be more appropriate
- If you want to give the chance to start searching from a specific index, you may also want to have a default value for that parameter (0 looks like a good choice)
- You don't need the third parameter, that's what you are going to return
This is my attempt at it:
big_s = 
for i in range(1,101):
if i % 10 == 0:
def looking_patt(pattern, index=0):
for i in big_s:
if i == pattern[index]:
index += 1
if index == len(pattern):
index = 0
print looking_patt([1, 2, 3])