Revolutionizing the Job Market | NxtWave
Fri May 31 2024 06:19:51 GMT+0000 (Coordinated Universal Time)
Saved by
@karthiksalapu
# Dictionary View Objects
# keys() , values() & items() are called Dictionary Views as they provide a dynamic view on the dictionary’s items.
# Code
dict_a = {
'name': 'Teja',
'age': 15
}
view = dict_a.keys()
print(view)
dict_a['roll_no'] = 10
print(view)
#output
# dict_keys(['name', 'age'])
# dict_keys(['name', 'age', 'roll_
content_copyCOPY
dynamic view of dictionary items. which means once extracting keys are defined as variable, they remain updated with adding or deleting the keys of dictionary.
https://learning.ccbp.in/problems-set?auth_code
Comments