0
def f1(x):
    return(x**2)
n = int(input("input amount of rectangles"));
a = int(input("input starting x"));
b = int(input("input ending x"));
w = ((b-a)/n);
for x in range(a,b,w): #rectangle algorithm for x^2
    area =int((f1(x)*w)) + area
print(area);

I never assigned a float value in the program, so why is it giving me this error?

Aalok Borkar
  • 85
  • 1
  • 6

0 Answers0