values(): a view object that displays all the values in a dictionary

values(), takes no argument .

Returns : View object containing values .

The original dictionary is not changed after this method.

view object of values

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
Subhendu Mohapatra — author at plus2net
Subhendu Mohapatra

Author

🎥 Join me live on YouTube

Passionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.



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-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer