Question: Write a function named create_squares_dictionary(n) which takes an integer as a parameter and creates a dictionary where the keys are the numbers between 1 and

Write a function named create_squares_dictionary(n) which takes an integer as a parameter and creates a dictionary where the keys are the numbers between 1 and n inclusive and the values are the squares of the keys.

For example:

Test Result
a_dict = create_squares_dictionary(3) for key in sorted(a_dict): print(key, a_dict[key])
1 1 2 4 3 9 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!