# Loop through integer values of x from -10 to 10
for x in range(-10, 11):
y = x**2 - 2*x + 1 # Calculate the value of y using the given function
print(f"For x = {x}, y = {y}")
Output
For x = -10, y = 121
For x = -9, y = 91
For x = -8, y = 73
For x = -7, y = 57
For x = -6, y = 43
For x = -5, y = 31
For x = -4, y = 21
For x = -3, y = 13
For x = -2, y = 7
For x = -1, y = 3
For x = 0, y = 1
For x = 1, y = 1
For x = 2, y = 3
For x = 3, y = 7
For x = 4, y = 13
For x = 5, y = 21
For x = 6, y = 31
For x = 7, y = 43
For x = 8, y = 57
For x = 9, y = 73
For x = 10, y = 91