Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Meet Python Variables

Python Basics: first name prints 'first name' in the console not 'Ada'. Why?

I followed Craig's code:

first_name = 'Ada' print('first_name') print('Hello, Mustafa') print('Mustafa is learning Python')

Yet, the console gives back: first name for the print function, not Ada. The other line are okay.

3 Answers

Because you have quotes around 'first_name' it is taken as a string.

Since you want to print the variable, leave out the quotemarks.

Thank you Zimri! This worked!

when we summon a variable we do not apply quotation marks as that will lead the console into thinking that the code you are running is using a string and not the variable

Yeah I saw that. Thanks for the discussion. How about when I enter

first_name = "Aida"

why should the name Aida be in quotes unlike when I write

first_name = 11

and the number 11 doesn't need to be in quotes?