Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+10 votes
4 views
in Python by (50.2k points)

I am getting an error while executing a python program. The line at which error is occurring is as follows:

print  wordlists(len(words))

This the error I am getting:

TypeError: 'list' object is not callable.

1 Answer

+11 votes
by (107k points)
edited by

The error in your problem states the list is not callable. This happens because you are trying to access/use a python list but using parenthesis for it. Parenthesis are applied to call a function and because a list is not a function, you get this error. To access or use a python list, you have to use square brackets. Try this:

print worldlists[len(words)]

To know more about this you can have a look at the following video:-

Related questions

0 votes
1 answer
+1 vote
1 answer
+2 votes
1 answer
+1 vote
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...