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

Trevor Rydalch
Trevor Rydalch
2,184 Points

Why do I keep getting a NameError?

I'm doing task 1 of 2. I've written one line of code:

varl = 'rovert'

And it keeps telling me that name 'varl' is not defined. Why?

When I write this code in Workspace, it has no error.

index.py
varl = 'rovert'

2 Answers

Steven Parker
Steven Parker
231,248 Points

It looks like you defined "varl" (ending with a lower-case "L")

:point_right: The challenge is asking you to define "var1" (ending with the number 1)

I recommend cut-and-paste when specific names or strings are required.

Jason Anders
Jason Anders
Treehouse Moderator 145,860 Points

Good call Steven.

But in his actual code snippet above, it looks like a number one. The typed part above looks like an L...

Sometimes fonts ... :anguished: LOL.

I have deleted my obvious erroneous answer. :)

Trevor Rydalch
Trevor Rydalch
2,184 Points

Thank you! Silly error. Good advice.