If I understand your question right, this is the solution:
you can use:
collections.Counter(num_list)
Or in case you what to understand how to implement the function,the following function will do the job:
def bin_counter(num_list):
num_dict = {}
for num in num_list:
try:
num_dict[num] += 1
except KeyError:
num_dict[num] = 1
return num_dict
And if you don't familiar with Exeptions, the following function will do the same just without usage of Exeptions:
def bin_counter(num_list):
num_dict = {}
for num in num_list:
if num in num_dict:
num_dict[num] += 1
else:
num_dict[num] = 1
return num_dict