- values() is a python dictionary function which return all values from the dictionary.
Syntax-
dict.values()
Example
dictionary is d={1:'a',2:'b',3:'c'}
program-
d=dict()
print("Enter key 1")
n=input()
d.fromkeys(n)
print("Enter value of key 1")
d[n]=input()
print("Enter key 2")
n=input()
d.fromkeys(n)
print("Enter value of key 2")
d[n]=input()
print("Enter key 3")
n=input()
d.fromkeys(n)
print("Enter value of key 3")
d[n]=input()
print("Dictionary is ",d)
print("All values of dictionary is",d.values())
print("All values of dictionary is",*d.values())
Enter key 1
1
Enter value of key 1
a
Enter key 2
2
Enter value of key 2
b
Enter key 3
3
Enter value of key 3
c
Dictionary is {'1': 'a', '2': 'b', '3': 'c'}
All values of dictionary is dict_values(['a', 'b', 'c'])
All values of dictionary is a b c