Computer Science, asked by vpsankar18, 7 months ago

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 Kaushikkalesh
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