Python
# Write squares(n): a generator that yields 1*1, 2*2, ..., n*n, one at a time.
def squares(n):
    pass