Friday, 7 May 2021

Python List: adding an item to the key's value list

#here menu_keys is the dictionary name, "cake" is the name of the key in the dictionary and "sugar" is the list item of the "cake" key of the given dictionary.


menu_keys['cake'].append('sugar')

No comments:

Post a Comment