Moses Ford
Moses Ford

Reputation: 23

TypeError: 'float' object is not callable when trying to use a specific math equation

I have an assignment for a university course that I'm doing and I need assistance on why I'm getting this TypeError.

The original equation is: Surface Area = 3√(25 + 10√5) * 𝑎^2

a = input("Edge Length: ")

suface_area = (3 * math.sqrt(25 + (10 * math.sqrt(5)) (a) ** 2))

print(surface_area)

I expect the written code to give me an output of the calculated "Surface area" that this equation is supposed to provide me, however I keep getting the TypeError message when the program tries to execute the code.

Please give me feedback on what I should try to fix this. Thanks!

Upvotes: 1

Views: 45

Answers (1)

Atlas Kua
Atlas Kua

Reputation: 16

Two tiny issues with your code is causing problems.

  1. You're missing a * in before (a)**2 in suface_area = (3 * math.sqrt(25 + (10 * math.sqrt(5)) (a) ** 2)).

  2. You misspelled the variable name suface_area when your print function is being told to printsurface_area.

Hope this helps!

Upvotes: 0

Related Questions