eLearning
Tutorials
Programs
Interview Questions
Technical Questions
C Language
C++
JAVA
HTML & CSS
PHP
AJAX
J2EE
SQL
jQuery
Go back to Home
Our Placements
Tutorials
Programs
Interview Questions
Technical Questions
Live Training
Our Placements
Associated Colleges
Our Recruiters
Back
C Language
C++
JAVA
HTML & CSS
PHP
AJAX
J2EE
SQL
jQuery
Programs
Home
Programs
Python
Dictionary
Programs - Python -
Dictionary
Program:
# Dictionary Comprehension
squares = {x: x*x
for
x
in
range(
6
)}
print(squares)
Output:
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}