Python dictionary values() Method


Contents

Description

Python dictionary technique values() revisits a catalog of entire the values accessible in a provided dictionary. values() is an inherent method in Python encoding language that arrivals a listing of all the values accessible in a agreed dictionary. Returns: returns a roll of all the values existing in a given dictionary. The values have been amassed in a reversed manner.

Syntax

Following is the syntax for values() method:

dict.values()

Parameters

  • NA

Return Value

This method returns a list of all the values available in a given dictionary.

Example

The following example shows the usage of values() method.

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7}
print "Value : %s" %  dict.values()

When we run above program, it produces following result:

Value : [7, 'Zara']

Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.



Navigation
Tutorial
Tutorial
Tutorial