Python Practice › Loop Programs › Program 67
Print the values of a dictionary
Write a Python program to print the values of a dictionary, capitalised.
Input
{"name": "virat", "sports": "cricket"}Output
Virat Cricket
Approach
- Loop over
values().
Solution
player = {"name": "virat", "sports": "cricket"}for value in player.values(): print(value.capitalize())Output
Virat Cricket
Learn the concept
New to this topic? Read the lesson, then come back.