Skip to content

Latest commit

 

History

History
executable file
·
9 lines (6 loc) · 447 Bytes

File metadata and controls

executable file
·
9 lines (6 loc) · 447 Bytes

Dictionary Square Keys

Define a function which can generate a dictionary where the keys are numbers between 1 and 20 (both included) and the values are square of keys. The function should just print the values only.

Hints:

Use dict[key]=value pattern to put entry into a dictionary. Use ** operator to get power of a number. Use range() for loops. Use keys() to iterate keys in the dictionary. Also we can use item() to get key/value pairs.