Quick actions

cmd+k|ctrl+k

Navigation

Languages

DICT (13-12-2024)

Snippet info

Language

Python

Visibility

public

Author

chausage

Created

2024-12-13T02:27:01.056694Z

Updated

2024-12-13T02:37:23.938514Z

tel={'Jack':4098, 'Sape':4139} #create a dict
tel['Bob']=4127 #add a new data
print(tel)

del tel['Sape'] #delete Sape 
tel['Ann']=4127 #add a new data
print(tel)

print(list(tel.keys())) #print tel keys 'names'

print(sorted(tel.keys())) #print tel keys 'names' alphabetically

print('Bob' in tel)
print('Jack' not in tel)
INFO