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 (Retired) Ins & Outs Ins & Outs

name = Paul is giving me a Name Error...! Paul is not defined!

Why do I get a Name Error when assigning my name to the variable 'name'?

Thanks!

name.py
name = Paul

2 Answers

Joshua Edwards
Joshua Edwards
52,175 Points

when you assign a variable like you have written, it is looking for a variable named Paul which doesn't exist. You want to assign the name variable a string which you do with quotes around the value you want to store.

Ha.. Yeah I realised the problem as soon as I posted..!! ;-) It's been a long day...!!

Thanks for your response!!