# counting

xs = ['eple', 'banan', 'eple', 'pære', 'banan']

to_buy = dict()

for x in xs:
    if x in to_buy:
        to_buy[x] += 1
    else:
        to_buy[x] = 1

print(to_buy)

for x in to_buy.keys():
    print(x)

for x in to_buy.values():
    print(x)    

for k, v in to_buy.items():
    print(k, v)   
