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

Philip Collins
Philip Collins
13,249 Points

Let's practice with indexes! Make a new variable named var1 that is either a list or a string. Make sure that var1[5],

its coming up with a NameError: varl is not defined?

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

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! This is a tricky one and I sort of wish they'd rename that variable. You've typed varl instead of var1. They look very similar don't they? But the one you have typed ends in a lower case "L". Theirs ends in the number one.

Note that when you make that correction, you will not need the second line of your code. This does become a bit more obvious on the second step when they ask for a var2.

Hope this helps! :sparkles:

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

I fixed the variable names to be less confusing!