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

Jabari Bellamy
Jabari Bellamy
9,513 Points

How do I create a variable and make sure that the item inside the string has an index of the value 5 with the item 't'?

I'm not sure what I did wrong here, because I really believe this code challenge to be very easy but for some reason I keep getting the bummer response. This code challenge couldn't be any easier. I have created the variable name varl like the code challenge question said and I chose to turn the value into a six letter word (advert) that has the last letter t at the end and I made sure that the letter 't' had a index value of [5]. What else is there to do, because I sure don't know. Any help or assistance would be highly appreciated.

index.py
varl = "advert"
varl[5]

2 Answers

Mike Brooks
Mike Brooks
3,389 Points

I did exactly as you did EXCEPT I omitted the second line and it passed. var1 = "advert"

Jabari Bellamy
Jabari Bellamy
9,513 Points

Thank you so much for pointing that out to me Mike, I definitely misread the number 1 for the letter l in the var1 variable. I have added the number 1 after var and I passed. Thank you so much again.

Ryan S
Ryan S
27,276 Points

Hi Jabari,

You defined the value of the variable correctly. The issue is that the font used in the challenge description makes it tough to distinguish between the lowercase letter 'l' and the number 1. It should be var1, as in "var-one".

Also, your second line of code is unnecessary, although it won't affect whether it passes or not (as long as it is named correctly).

Good luck.

Jabari Bellamy
Jabari Bellamy
9,513 Points

Thank you so much Ryan, I didn't even realize that I misread the number 1 in the word var1 for the letter l. I knew that this code challenge was simple, but I always have to realize that I have to read the question word by word and line by line to make sure that I fully comprehend what the question is asking me. Thank you so much mate for pointing out that major road block for me, I really appreciate it.