l = [(3, '655'), (3, '645'), (3, '641'), (4, '602'), (4, '674'), (4, '620')]
from collections import defaultdict
d = defaultdict(list)
for i, j in l:
    d[i].append(int(j))
d
Averaging the values in a dictionary based on the key