When the user gives input it puts it in a dictionary. When nothing or blanc is filled in it code should stop and give all the inputs + occurences in the dictionary.
nummer = 1
def namen(namen):
var = 1
key = {}
while var == 1:
invoer = input('Volgende naam: ')
if invoer != '':
global nummer
key[nummer] = invoer
nummer +=1
else:
return key
break
hey = (namen(5))
I tried counter
and a for
loop but that doesn't work.
So for instance if input = `h, d, d, hh, a, s
`it should give `
h=1
d=2
hh=1
a=1
s=1`