It will have memory impact though with larger range.
A better approach might be:
squares = lambda: (x * x for x in range(10))
print(min(squares))
print(max(squares()))