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 trialMustafa Kasim
1,938 PointsPython 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
Zimri Leijen
11,835 PointsBecause you have quotes around 'first_name' it is taken as a string.
Since you want to print the variable, leave out the quotemarks.
Courage Ngonidzaishe Moyosvi
28,998 Pointswhen 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
malvernm
187 PointsYeah 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?
Mustafa Kasim
1,938 PointsMustafa Kasim
1,938 PointsThank you Zimri! This worked!