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) Tuples Multiple Return Values

henry duquesnay
henry duquesnay
6,976 Points

Teacher Note Says Index -> Video Says Index +1?

What am I missing?

teacher's notes has this example:

• >>> my_list = [5, 2, 4, 1, 3] • >>> for index, value in enumerate(my_list): • . . . print("{}: {}".format(index, value)) • 0: 5 • 1: 2 • 2: 4 • 3: 1 • 4: 3

But the video says use Index +1 to enumerate through the alphabet example.

1 Answer

Josh Keenan
Josh Keenan
20,315 Points

In the video he is going over the alphabet, the loop starts at the 0th index but by adding the +1 to the format, the alphabet will be output as such:

1:a
2:b
3:c

Instead of:

0:a
1:b
2:c