Write a Python script to generate and print a dictionary that contains a number (between 1 and n) in the form (x, x*x).
Sample Dictionary ( n = 5) :
Expected Output : {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
need ans quickly pls
Answers
Answered by
9
n = int(input())
dic = { }
for x in range(1, n+1):
dic[x] = x*x
print(dic)
Please Thank Me
And Mark this as Brainliest
Similar questions
English,
3 months ago
Social Sciences,
3 months ago
Social Sciences,
7 months ago
English,
7 months ago
English,
10 months ago
English,
10 months ago
English,
10 months ago