I'm sorry for the mixup. Below is the code I've written that should have been in my OP (the incorrect code is from another problem).
def number_of_item_types(d): return (len(d['items']))Thank you for all of your help. I understand now.