Count occurrences of a specific sequence in a list of many numbers The script will work through each number from 0 - 10.
aList=[3,5,... over 10k numbers ...,2,2,6]

Let’s say, for example: findSquence01=[3,5] or findSquence02=[3,5,3]
count = 0
for i in range(len(data)-len(pattern)+1):
    tmp = [data[i], data [i+1]]

    try:
        for j in range(len(data)-i):
            print(i, i+j)
            if tmp[-1] != data[i+j+1]:
                tmp.append(data[i+j+1])

            if len(tmp) == len(pattern):
                print(tmp)
                break
    except:
        pass

    if tmp == pattern:
        count +=1


i- represents times of [3,5]
j- represents times of [3,5,3]

print(&quot;There is&quot;,i,&quot;times&quot;,findSquence01)
print(&quot;There is&quot;,j,&quot;times&quot;,findSquence02)

The output should look like:

There is 73 times [3,5]
There is 12 times [3,5,3]

How can I walk through the list and count those given sequences?
Try to keep your solution as general as possible. If I'm reading your code snippet right, you're trying to solve the problem for two patterns simultaneously. Instead, write a simple function that takes a list and a pattern, and just loops through the list counting occurrences of the pattern. This is a nice use case for list slices: given a list a, a[i:j] is a list consisting of elements i through j-1 of a. 

def count_sequence(lst, seq):
     count = 0
     len_seq = len(seq)
     upper_bound = len(lst)-len_seq+1
     for i in range(upper_bound):
         if lst[i:i+len_seq] == seq:
             count += 1
     return count


Try to avoid exceptions if possible*. A rule of thumb is that exceptions are for exceptional situations. In your case, you're designing your code around the fact that you're going to get IndexErrors, whereas the function I wrote keeps the array bounds in mind and thus won't raise IndexErrors. Additionally, never write except: pass. The point of the except block is to catch errors and do something with them, so don't pass over them. 



* Python itself doens't always follow this advice; for example, loops in Python are ended by raising the StopIteration exception. Nevertheless, for user-level code it's usually a good idea to only use exceptions if absolutely necessary.