Quick actions

cmd+k|ctrl+k

Navigation

Languages

Python Web - L03(Dict.)

Snippet info

Language

Python

Visibility

public

Author

victormakwaitat

Created

2025-02-05T03:05:49.699636Z

Updated

2025-02-05T04:18:51.118629Z

def a():
    print("I am from function a")
person = {
    'name' : 'john',
    'age' : (10,12,),
    'id' : [1,2,3,4],
    'people' : {'name' : 'peter'},
    'func' : a
}
print(person)
person['name'] = 'ann'  #  person['id'].append('ann')
print(person)
print(id(person['id']))
print(person['id'][1])
person['address'] = 'price building'
print(person)
del person['address']
print(person)
person['people']['name'] = 'ann'
print(person)
person['func']()
y = person['func']()
print(y) # print "I am...a" firstly, and then print "None"
INFO