I have to do an exercise that ask me to do a function that find the frequency of consecutive values on a list and return a list of tuples where I have to show how many times it was the repetition.

Input:

```
[1, 1, 1, 3, 5, 1, 1, 3, 3]

```

Output:

```
[(1,3) , (3,1) , (5,1) , (1,2) , (3,2)]

```

Code:

```
def empaquetar(l):

lista = []
for i in range(len(l)-1):
    cont = 0
    j = i + 1
    while l[i] == l[j] and j<len(l)-1:
        cont += 1
        i += 1
        j += 1
    if cont > 0:
        lista.append((l[i], cont + 1))
    else:
        lista.append((l[i],1))
return lista

```

Well, what I wrote does not quite exactly return what I want and I can't find a solution but I search a lot, for example the tool Counter from collection or something like. I need help, any suggestion?