Convert the following loop in the function to one that uses recursion
def square(n):
for i in range(1, n+1):
print(i*i, end=" ")Convert the following loop in the function to one that uses recursion
def square(n):
for i in range(1, n+1):
print(i*i, end=" ") print(n*n, end=" ")
if n == 1:
print(n*n, end=" ")
def convert(n):
convert(n-1)
else:
Create a free account to access the full topic