Number Patterns - squares and cubes of numbers

# Number Patterns

# Squares and cubes of Numbers


Num_of_terms = int(input("Enter number of terms : "))

val = 1


print("Number Patterns : ")

print("Squares of Numbers : ", end="")

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

print(i*i, end=" ")


print("\nCubes of Numbers : ", end="")

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

print(i*i*i, end=" ")

No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu