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

George Dinmore
George Dinmore
518 Points

Task one of two, passed, come onto task one of two, its saying Task one is no longer passing. Please help? Confused!

In task one was var_one, which passed. I then wrote var_two, and var_one no longer passes. Confused as hell now, considering it worked first time. Please help?

index.py
var_one = ["h", "e", "l", "l", "o", "t"]
var_one.index("t")

var_two = ["hellet"]
var_two.index("-2")

1 Answer

stjarnan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
stjarnan
Front End Web Development Techdegree Graduate 56,488 Points

Hi George,

First they want you to put the string 't' at index-position number 5 in the var_one list, right? Exactly what you did, great!

Then on the second task, they want you to put the string 'e' at index-position -2 in the list var_two. You only had one string here called 'hellet'. You do not need the var_one.index() part.

I hope that helps :)

Jonas

George Dinmore
George Dinmore
518 Points

That was very helpful, with me watching the previous video as well.

I was thinking the same way as var_one, but i completely forgot about the other way.