Python Dictionary values() Method

values_view = my_dict.values() returns a dynamic view of the dictionary values. The view is linked to the original dictionary and reflects later changes.

See the complete Dictionary Methods table for the other dictionary operations in this cluster.

my_dict={'a':'One','b':'Two','c':'Three'}
x=my_dict.values()
print(x)
Output is here
dict_values(['One', 'Two', 'Three'])

View object reflects the changes in dictionary.

my_dict={'a':'One','b':'Two','c':'Three'}
x=my_dict.values()
print(x)
my_dict.update({'c':'New Value'})
print(x)
Output (2nd print(x) reflects the changes )
dict_values(['One', 'Two', 'Three'])
dict_values(['One', 'Two', 'New Value'])

All dictionary methods


Subscribe to our YouTube Channel here



plus2net.com







Python Video Tutorials
Python SQLite Video Tutorials
Python MySQL Video Tutorials
Python Tkinter Video Tutorials
✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer