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 Python Collections (2016, retired 2019) Dungeon Game Dungeon Entrance

"It might make sense to be a tuple if you were doing a large grid, numbers and numbers of cells"

I don't understand this statement. Why would it make sense if you were doing a large grid? Wouldn't it also make sense for whatever length of the grid?

1 Answer

Steven Parker
Steven Parker
231,236 Points

You're right, that comment flys by without explanation. If Kenneth were still a teacher I'd tag him and ask what he meant by that.

As is, I will speculate that a tuple might offer efficiency advantages over a list that would become noticable when there were a very large number of items. But that's purely a guess.

Thanks! It really might be it.

I was thinking about it and the only conclusion I came to is that for a very large grid, numbers and numbers of cells, there would have no need to add new cells to the grid. You could work with slices and make any smaller grid from the bigger one. In that case, CELLS could be a tuple, since you wouldn't be adding any more cells. But I'm also speculating haha.