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 Splitting and Joining

Henning Holm
Henning Holm
4,163 Points

Word 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
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Haider Ali
Python Development Techdegree Graduate 24,728 Points

If 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
Henning Holm
4,163 Points

I see! I just realized the word pizza was already assigned to a value... sorry, not very bright question! Thanks for making understand this! :)

Make sure when someone gives you a good answer that you mark the question as complete.

Henning Holm
Henning Holm
4,163 Points

Okei, do I click the "Best Answer" button to do that?

Yep :)