Python Practice › Loop Programs › Program 67

Print the values of a dictionary

EasyLoop Programs · 67 of 90

Write a Python program to print the values of a dictionary, capitalised.

Advertisement
Input
{"name": "virat", "sports": "cricket"}
Output
Virat
Cricket

Approach

  1. Loop over values().

Solution

Python
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.

More loop programs

← All 90 Loop Programs

Leave a Comment