Answers for "an exception occurred: 'method' object is not subscriptable"

7

TypeError: 'method' object is not subscriptable

You need to use parentheses: myList.insert([1, 2, 3]). When you leave out the parentheses, python thinks you are trying to access myList.insert at position 1, 2, 3, because that's what brackets are used for when they are right next to a variable.
Posted by: Guest on July-09-2020

Code answers related to "an exception occurred: 'method' object is not subscriptable"

Python Answers by Framework

Browse Popular Code Answers by Language