Post

Python Dictionary values()

In Python dictionary, the values() method returns all the values of a given dictionary inside a list..

Python Dictionary values()

The syntax of values() is:

1
2
dictionary.values()

values() Parameters

The values() method does not take any parameters.

Let see an example of the values() method.

Example 1: How to use the values() method on a python dictionary?

1
2
3
car = {"brand": "Ford", "model": "Mustang", "year": 1964}
print(car.values())

Output:

1
2
dict_values(['Ford', 'Mustang', 1964])

Rules of values()

There are no such rules for the values() method.

This post is licensed under CC BY 4.0 by the author.