Q. Write a program that prints out a list of the integers from 1 to 20 and their squares. The output should look like this:


1---1
2---4
3---9
….
20---400


Answer =

 

for i in range (1,21) :
    print (i , "---", i ** 2)

 

1 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post