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 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?