I'm struggling to figure out how to properly use Python to solve a quadratic inequality.
I'm trying to learn Python a bit and I'm trying to work through a quadratic inequality. I have a range of numbers for x from -5 to 5 and I want to use the equation y(x) = x**2 to calculate y(x) for all values greater than 0.
x = (-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5)
def y(x):
if x >= 0:
return x**2
print(y(x))
TypeError: unsupported operand type(s) for ** or pow(): 'tuple' and 'int'