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 trialYI JIANG
3,424 Pointsvar questionsLeft = ' [' + questions + ' questions left]'; I don't get it why add [ ]
why add [ ],questionsLeft = ' [' + questions + ' questions left]';
3 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Yi Jiang,
Try taking a look at the prompt at around 1:28 in the video.
You should see the prompt "Please type an adjective [3 questions left]"
The brackets are simply part of the prompt string. It was how Dave wanted the output to look but you can put whatever you want there.
Shawn Denham
Python Development Techdegree Student 17,801 Pointsoh man, thanks Jason Aiello I was really trying to figure out what exactly she was asking! +1 for you
mike sanford
2,389 PointsSame here so it would not matter if I used () or [] in that string? Does that go for anytime we use () can we always substitute [] ?
Jason Anello
Courses Plus Student 94,610 PointsHi Mike,
If it's part of an output string then it wouldn't matter. It was only a personal preference on the part of the teacher to use the brackets.
mike sanford
2,389 PointsUnderstood. Thank you for the reply.
Ontopofworld 11
Courses Plus Student 309 PointsOntopofworld 11
Courses Plus Student 309 PointsWow thanks for this question I was so confused with it as well