what i want:
count odd numbers of list a
my code as following:
def find_it(seq):
set_seq=set(seq)
dict_seq = {}
for item in set_seq:
dict_seq.update({item:seq.count(item)})
print(dict_seq)
a=[20,1,-1,2,-2,3,3,5,5,1,2,4,20,4,-1,-2,5]
print(find_it(a))
This outputs:
{1: 2, 2: 2, 3: 2, 4: 2, 5: 3, 20: 2, -2: 2, -1: 2}
None
Why does it output None
?