By using
items method, we can retrieve the key and corresponding value.
>>> emps1 {1: {'Hari Krishna', 'Gurram'}, 3: {'Shekkappa', 'Mohan'}, 4: {'Ranganath', 'Thippisetty'}, 5: {'Ganji', 'Sudheer'}} >>> >>> for key, value in emps1.items(): ... print(key, value) ... 1 {'Hari Krishna', 'Gurram'} 3 {'Shekkappa', 'Mohan'} 4 {'Ranganath', 'Thippisetty'} 5 {'Ganji', 'Sudheer'}
No comments:
Post a Comment