Answers for "python dictionary of lists append"

3

python dictionary of lists append

# Creating an empty dictionary 
myDict = {} 
  
# Adding list as value 
myDict["key1"] = [1, 2] 
  
# creating a list 
lst = ['Geeks', 'For', 'Geeks'] 
  
# Adding this list as sublist in myDict 
myDict["key1"].append(lst) 

# Print Dictionary
print(myDict)
Posted by: Guest on June-22-2020

Code answers related to "python dictionary of lists append"

Python Answers by Framework

Browse Popular Code Answers by Language