2

Can't find what's wrong with this code. Can someone help me to fix this, please ?

def f(x):
    a = (-5 * (int(x) ** 5) + 69 (int(x) ** 2) - 47)
    return a

print f(0)

Thanks in advance !

3 Answers 3

10

An operator is needed between 69 and (int(x) ** 2).
If you meant to use multiplication, then you need to use * explicitly

Sign up to request clarification or add additional context in comments.

1 Comment

Adding to this correct answer, I'd suggest you break long expressions into smaller chunks and use temporary variables.. It makes the code a bit longer but much more readable, also easier to avoid these kinds of silly syntax errors.
4

in this sequence

a = (-5 * (int(x) ** 5) + 69 (int(x) ** 2) - 47)

69 is considered as function call because of the open parenthesis (, so python tries to call 69 as callable but int instance is not callable.

Comments

1

You are missing an operation between the 69 and (int(x) ** 2) in your equation.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.