Hinzufügen von Elementen zu einem Python -Wörterbuch
# welcome to softhunt.net
# Creating an empty Dictionary
Dictionary = {}
print("Empty Dictionary: ", Dictionary)
# Adding elements one at a time
Dictionary[0] = 'Softhunt'
Dictionary[1] = '.net'
print("\nDictionary after adding 2 elements: ", Dictionary)
# Adding set of values
# to a single Key
Dictionary['Value_set'] = 2, 3, 4
print("\nDictionary after adding 3 elements: ", Dictionary)
# Updating existing Key's Value
Dictionary[2] = 'Greetings'
print("\nUpdated key value: ", Dictionary)
# Adding Nested Key value to Dictionary
Dictionary[3] = {'Nested' :{'i' : 'Hello', 'ii' : 'User'}}
print("\nAdding a Nested Key: ", Dictionary)
Outrageous Ostrich