-
With a given integral number
n
, write a functiongenerate_dict
that generates a dictionary that contains(i, i*i)
that is an integral number between 1 and n (both included). -
generate_dict
should then print the dictionary.
generate_dict(8)
- {1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64}
-
In case of input data being supplied to the question, it should be assumed to be a console input.
-
Consider use
dict()