Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Basic Object-Oriented Python Creating a Memory Game Game Class Part 1

Leah Kelly
Leah Kelly
4,141 Points

TypeError: 'list' object is not callable

I tried:

def set_cards(self):
    used_locations = []
    for word in self.card_options:
      for i in range(2):
        available_locations = set(self.locations) - set(used_locations)
        random_location = random.choice(list(available_locations))
        used_locations.append(random_location)
        card = Card(word, random_location)
        self.cards.append(card)

But all it gives me is: TypeError: 'list' object is not callable

1 Answer

Steven Parker
Steven Parker
229,732 Points

A bit more context would help facilitate analysis. Take a look at this video about sharing a snapshot of your workspace.