Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for key,val in info.items(): # to get all keys & values
- print( key,'=>',val )
- print( info.keys() ) # to get all keys
- print( info.values() ) # to get all values
- print( info.items() ) # to get all keys & values as list
- print( info )
- del info['id'] # to delete any key
- print( info )
- print( info.get( 'age', 'not found' ) ) # get method doesn't show error if key not found
Advertisement
Add Comment
Please, Sign In to add comment