Python script to generate and print a dictionary that contains a number (between 1 and n) in the form (number, square of number)


n=int(input('Enter Any number ?')) 

d=dict()

for i in range(1,n+1):

    print(d.update({i:i*i}))

Comments

Some popular posts

Python Program that computes the net amount of a bank account based a transaction log from console input.