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 trialJon Bunday
411 Pointsno sure what i'm doing wrong
let name = "Jon"
let greeting = "How are you?"
let finalGreeting = "Hi there, \(name). \(greeting)"
3 Answers
Steve Hunter
57,712 PointsYou want to use concatenation for the last part of the challenge, i.e. add the strings together:
// Enter your code below
let name = "Jon"
let greeting = "Hi there, \(name)."
let finalGreeting = greeting + " How are you?"
(Remember the space in front of How)
Steve.
Steve Hunter
57,712 PointsHi Jon,
You need to be pretty prescriptive and follow the output that the challenge wants precisely else it'll fail you:
// Enter your code below
let name = "Jon"
let greeting = "Hi there, \(name)"
That should get you through the first bit. It is expecting that output, not the extra bit you added, that's all.
Steve.
Jon Bunday
411 Pointsok thanks
Steve Hunter
57,712 PointsMy apologies, I didn't help you with the right bit of the code challenge there. That's my fault for rushing!!
Let me try that again - I'll edit this post in a minute.
Steve.
Jon Bunday
411 PointsNo problem i was just about to say that, hehe. Thanks for the help
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsIt took me far too long to read the question and notice why my code wasn't working!!