Squares

Report a typo

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=" ")
Reorder lines using drag or arrows. Adjust indentation with left buttons
                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