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

Abdulkadir Kollere
Abdulkadir Kollere
1,723 Points

NameError

Hi there,

var1 = 'abcdet' print(varl[5])

It gives me the error "NameError: name 'varl' not identified. this got me stuck the whole day. Kindly assist.

index.py
var1 = 'abcdet'
print(varl[5])

1 Answer

Chase Marchione
Chase Marchione
155,055 Points

Hi Abdulkadir,

In the first line, it looks like you have the number 1 in the variable name, but in the second line, you have a lowercase l instead. If you switch the latter to a 1, the code should pass.

Hope this helps!

Abdulkadir Kollere
Abdulkadir Kollere
1,723 Points

"varl = list('abcdet')" worked. I dont know why the string did not work though. Thanks for the response.