0

So I try to pass this through Python:

print("Strength:",stats[0])
print("Defense:",stats[1])
print("Agility:",stats[2])

...and I get this in return:

TypeError: 'function' object is not subscriptable

What does this mean and how do I fix it?

1 Answer 1

4

It means that stats is a function instead of a sequence. Perhaps you forgot the parens on an earlier function call.

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

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.