Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
19,565 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