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) Lists Shopping List Take Three

Show list

Why did he place the show_list() at the beginning of add_to_list() function. It will first show list and then add that contemporary item to the list. So the list shown will be incomplete, won't it be?

1 Answer

Francesc Box
Francesc Box
1,637 Points

He did that because now we ask user in which position to insert the new item.

So, before asking where to insert, it's nice to show current items and their position, so user can decide. Otherwise, user should remember the list components and positions by heart.