values() method of dictionary

All dictionary methods

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

Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here





    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 FORUM . Contact us
    ©2000-2021 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer