Dictionary in Python
Dictionary in Python
Omputer
Science -
XII
Santosh Kumar
PGT Comp. Sc.
Output:
Initial Dictionary: {'B': {1: 'Geeks', 2: 'Life'}, 'A': {1: 'Geeks', 2: 'For', 3:
'Geeks'}, 5: 'Welcome', 6: 'To', 7: 'Geeks’}
Deleting a specific key: {'B': {1: 'Geeks', 2: 'Life'}, 'A': {1: 'Geeks', 2: 'For', 3:
'Geeks'}, 5: 'Welcome', 7: 'Geeks’}
Popping specific element: {'B': {1: 'Geeks', 2: 'Life'}, 'A': {1: 'Geeks', 2: 'For', 3:
'Geeks'}, 7: 'Geeks’}
Pops an arbitrary key-value pair: {'A': {1: 'Geeks', 2: 'For', 3: 'Geeks'}, 7: 'Geeks’}