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 9, 2019 in Python by Vaishnavi
29,095 views

1 answer to this question.

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)]


Hope this helps!!

If you need to know more about Python, join Python certification course today.

Thanks!

answered Feb 9, 2019 by Omkar
• 69,230 points
no its not coming even we use square brackets its showing that in the bracket its hould be indexing or slicing but not range

Hi, @Ganapuram,

Could you please post here what you are trying to do and what exactly your error is? It will be helpful for me to investigate on that.

by doing so i m getting ##even we use square brackets its showing that in the bracket its hould be indexing or slicing but not range##

Try to print your output within a bracket.

print (worldlists[len(words)])

Related Questions In Python

0 votes
0 answers

TypeError: 'list' object is not callable in python

I am a beginner in Python, created ...READ MORE

Feb 3, 2022 in Python by Nandini
• 5,480 points
982 views
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, 2019 in Python by Priyaj
• 58,100 points
2,835 views
0 votes
1 answer

i am normalizing the data set iris in python and get the error ::TypeError: 'numpy.float64' object is not callable

TRY THIS   #Nomalisation for i in names:     print(i)   ...READ MORE

answered Aug 20, 2019 in Python by Noel Deepak Palle
5,785 views
0 votes
1 answer

Python error "'Series' object is not callable "

Try this: df['ln_returns'] = np.log(df['Close_mid']/df['Close_mid']) df['Close_mid'](1)) doesn't seem to ...READ MORE

answered Jul 22, 2019 in Python by Greg
17,421 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,354 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
3,912 views
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
• 69,230 points
13,525 views
0 votes
3 answers

Python error "NameError: name 'sr' is not defined"

NameError: name 'xx' is not defined Python knows ...READ MORE

answered Mar 19, 2020 in Python by rahul
• 360 points
42,350 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP