I need to make a list comprehension to create a list of squared numbers. The function has the parameters start and end, and I want it to returns a list of squares of consecutive numbers between start and end inclusively.
I've tried various ways to solve this problem, but I've failed. I have also removed my code, that I wrote in attempts to solve the question.
def squares(start, end):
return [ ]
print(squares(2, 3)) # Should output [4, 9]
print(squares(1, 5)) # Should output [1, 4, 9, 16, 25]
print(squares(0, 10)) # Should output [0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100]