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. (

Comment on Disqus:

Comment on Twitter:

Question difficulty: πŸ”΅πŸ”΅πŸ”΅πŸ”΅πŸ”΅

Similar questions: