ANSWER IT
DO IN PYTHON LANGUAGE:
Attachments:
Answers
Answered by
0
Answer:
def square(num):
return num*num
def cube(num):
return num*num*num
def main_function():
n = int(input('Give value of n: '))
for i in range (1, n):
print(square(i))
print(cube(i))
main_function()
Explanation:
Answered by
1
Question:-
- WAP to accept and print squares and cubes of first 10 natural numbers.
Program:-
In python,
print("Squares of the first 10 natural numbers are... ")
for i in range(1,11):
print(i**2, end=" ")
print("\nCubes of the number are.. ")
for j in range(1, 11):
print(j**3,end=" ")
Similar questions