Apslis Apslis - 3 years ago 306
Python Question

unsupported operand type(s) for *: 'float' and 'builtin_function_or_method'

I cannot for the love of my life figure out why I get the message: "unsupported operand type(s) for *: 'float' and 'builtin_function_or_method'". I've looked at pretty much all the suggestions on this website. Please help!

Answer Source

math.cos is a function, in particular it's a builtin_function_or_method - which explains the error message.

That means you have to call it with an argument to get a number, just like you did with math.exp and math.sqrt.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download