+1 vote
2 views
in Python by (220 points)

When I executes my python program it shows the error

TypeError: 'list' object is not callable.

In these two lines

print  wordlists(len(words)) 
        (wordlists(len(words))).append(words) 

1 Answer

0 votes
by (73.7k points)

If the wordlists is a list, you cannot access the list using "( )" but use "[ ]" for accessing the elements of the list. So, replace those lines with the following code:

print worldlists[len(words)]

worldlists[len(words)].append(words)

IIf you want to become a pro in Python, you can check out this Python Course by Intellipaat that offers instructor-led training, hands-on assignments, and certification. 

Related questions

0 votes
1 answer
0 votes
1 answer
asked Aug 30, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
asked Sep 26, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...