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

Shali Dan
Shali Dan
741 Points

week number??

if the first week is 0, why does making week number 1 work??

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,426 Points

Hey Shali Dan, regarding the multidimensional lists video, there are two variables used in the loop:

  • week is a list of values from the list travel_values. Each loop will be the next week’s value starting at the 0-th week.
  • workweek_number is a manually incremented value to keep track number of times the loop has executed. It is used only as a print value and not to index in the lists.

Later in the courses, you will near about the enumerate() function that automatically produces a loop counter along with an item from an iterable.

Post back if you need more help. Good luck!!!

Shali Dan
Shali Dan
741 Points

thank you for the explanation!