Quick actions

cmd+k|ctrl+k

Navigation

Languages

Dictionary Method 1

Snippet info

Language

Python

Visibility

public

Author

ak.amita28

Created

2026-04-15T10:20:24.882811Z

Updated

2026-04-15T10:50:45.954897Z

user = {
    'test' : [1,2,3],
     'greet' : 'Morning',
      'age' : 20,
}

print(user.get('age' , 50))

user2 = dict(name = 'Amita') # not a correct way to form dictionary
print(user2)

print('test' in user)
print('line' in user)
INFO