Python TypeError: 'list' object is not callable.

0 votes

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.

Feb 8 in Python by Vaishnavi
785 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The error says the list is not callable because you are trying to access/use a python list but using parenthesis for it. Parenthesis are used to call a function and because a list is not a function, you get this error. To access/use a python list, you should use square brackets. Try this:

print worldlists[len(words)]
answered Feb 8 by Omkar
• 66,880 points

Related Questions In Python

0 votes
1 answer

print(instance(0).id) TypeError: 'list' object is not callable

Hey @Suraj, For me its working fine. ...READ MORE

answered Jan 18 in Python by Priyaj
• 56,140 points
102 views
0 votes
1 answer

How can I convert a list of dictionaries from a CSV into a JSON object in Python?

You could try using the AST module. ...READ MORE

answered Apr 17, 2018 in Python by anonymous
472 views
0 votes
1 answer

Python join: why is it string.join(list) instead of list.join(string)?

950down voteaccepted It's because any iterable can be ...READ MORE

answered May 15, 2018 in Python by ariaholic
• 7,320 points
23 views
0 votes
1 answer

Python join: why is it string.join(list) instead of list.join(string)?

This is because join is a "string" ...READ MORE

answered Jul 30, 2018 in Python by Priyaj
• 56,140 points
52 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
54 views
+4 votes
6 answers
0 votes
1 answer

Python argparse error "NameError: name 'file' is not defined"

The right datatype for destination in argpasrse module ...READ MORE

answered Nov 28, 2018 in Python by Omkar
• 66,880 points
804 views
0 votes
2 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.