Write a python function to generate Square Numbers (1, 4, 9, 16, 25...)


Topic: Write a python function to generate Square Numbers (1, 4, 9, 16, 25...)

Solution

def square_numbers(n):
    for i in range(n):
        yield i ** 2
        
        



List all Python Programs