Python Dictionary values() Method with Example

Python Dictionary values

Now, we are going to have a look at the values method. The values method is going to give us a view object of values of the dictionary. The object contains the values of the dictionary. Let’s have a look at a sample program, which would help us better understand the keys method, and also help us visualize the output.

Python Dictionary values() Method

As you can see in the above program, we have a simple dictionary, and then we are trying to make use of the values method on the dictionary. We are directly printing the output of the values method. If you have a look at the output, you can simply understand that we are getting the object with the values from the dictionary. So, as and when required, we can make use of the values method in our programs.