Skip to content
Advertisement

How to print a dictionary line by line in Python?

This is the dictionary

JavaScript

Using this for loop

JavaScript

It prints the following:

JavaScript

But I want the program to print it like this:

JavaScript

I just started learning dictionaries so I’m not sure how to do this.

Advertisement

Answer

JavaScript

output:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement