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 trialHenning Holm
4,163 PointsWord without quote marks
If I connect a word to a variable without using quote marks like: favorite_food = pizza . What is pizza now defined as, since its not a string or an integer?
3 Answers
Haider Ali
Python Development Techdegree Graduate 24,728 PointsIf you try and do this and pizza is not already a variable with a value, it will give you a name error. If you try and assign something that does not exist like an undefined variable to another variable, it will always give you NameError. However if a pizza variable does exist, then favorite pizza's value will be the value of pizza. E.g. If pizza holds the integer 1
and you do favorite_food = pizza
then favorite food will also hold the value 1.
Henning Holm
4,163 PointsI see! I just realized the word pizza was already assigned to a value... sorry, not very bright question! Thanks for making understand this! :)
Chris Campisi
1,226 PointsMake sure when someone gives you a good answer that you mark the question as complete.
Henning Holm
4,163 PointsOkei, do I click the "Best Answer" button to do that?
Chris Campisi
1,226 PointsYep :)