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 Basics (2015) Python Data Types Specific Index value

victor E
victor E
19,145 Points

this question is worded weird

what am I being asked to do? this is worded weird

index.py

2 Answers

Stuart Wright
Stuart Wright
41,118 Points

It wants you to create a variable called var1, and store a string in that variable such that index 5 (the 6th character) is a 't'. For example:

var1 = "stuart"

First, the challenge asked you to make a variable named var1 that has the letter t in the 5th position, Ex: var1 = '01234t6'. notice that the 't' is placed in the 5th position if you count from 0. Then, the challenge asked you to make another variable named var2 that has the letter 'e' in the -2nd position. Ex: var2 = '01234e5'. ** Notice that if you count from the left, you'll find that 'e' will be in the -2nd position. Hope this helps you out :)