The values( ) Function is used to return all the values in the Dictionary.
x = { 5 : "Is a Number", "John": "Is a Name", "Python": "Is a Language" } for i in x.values(): print(i)
So, in the above code we have created a 'Dictionary' using braces '{ }' and 'Key' and 'Value' pairs.
x = { 5 : "Is a Number", "John": "Is a Name", "Python": "Is a Language" }
And initialised to the variable 'x'.
In the next line we have used the 'for loop' to Iterate through the 'Dictionary' just to get the 'Values'.
for i in x.values(): print(i)
Now, since there is a 'Key' and 'Value' pair in a 'Dictionary', we have used the 'values( )' Function, that will only print the 'Values' and not the 'Keys'.
And if you see the Output, just the 'Values' are printed.