Question #115

Which syntax below won't work to add a new item to the dictionary my_dict? (Python 3.5+)

There is no explicitly defined method to add an item to a dictionary. From Python 3.5 onwards, the syntax {**my_dict, 'new_key': new_val} can be used. (stackoverflow.com/questions/1024847/how-can-i-add-new-key...)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵


Similar questions: