I am trying to create a dictionary where the key values are stored in a list like this :
data={ "key_value":["h1","h2","h3"], "key_value2":["h11","h21","h31"], } While adding elements to this list of dicts, I am using this function :
data[book_name].append(highlight) But this gives me a key error KeyError: 'Key_value ' Why is this happening?
没有评论:
发表评论