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 trialmax pajunen
1,546 PointsAssertionError: ('Hello ', 'Ashley') != 'Hello Ashley'
The question suggests a spelling error? I've read it over a dozen times and I can't find the issue.
def hello_student(name):
return ('Hello ', name)
1 Answer
Eric Ryan
Python Development Techdegree Graduate 26,123 PointsWhen you concatenate in Python a comma automatically adds a space between the strings you are concatenating. However, by using parentheses and a comma you are actually returning a tuple, not a concatenated string. So you can correct it by removing the space in ‘Hello ‘ and the parentheses or you can use the + operator to concatenate the string.
Michael Hulet
47,913 PointsMichael Hulet
47,913 PointsI don't think the comma operator is a concatenation operator in Python. The comma is what makes the tuple, no parentheses required. The rest of your answer is spot-on, though
Eric Ryan
Python Development Techdegree Graduate 26,123 PointsEric Ryan
Python Development Techdegree Graduate 26,123 PointsMichael Hulet, yes, my mistake. Within a print function a comma will behave as I stated in my answer. I’m not sure if it works the same way anywhere else. But you’re right, it’s the comma that makes the tuple, not the parentheses.