Monday, 24 January 2022

Write a Python script to generate and print a dictionary which contains a number (between 1 and n) in the form(x,x*x).

Slip 20 Q 2

CODE :


n=int(input("Input a number : "))
d ={}
for x in range(1,n+1):
    d[x]=x*x
print(d)


OUTPUT :



No comments:

Post a Comment

Write a Java program to display given extension files from a specific directory on server machine.

 DOWNLOAD     SLIP14Q2 /** * STEPS TO RUN CODE * Step 01 compile the code * Step 02 run the code * Step 03 give a file directory locatio...