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 trialNolan Figueroa
3,533 PointsWhat seems to be the problem? Xcode is reading giving me the same output, without errors.
I created an interpolated constant with a literal string within, and although Xcode shows no errors and is displaying the correct output, I wonder why it's not working here. Please help.
// Enter your code below
let name = "Nolan"
let greeting = "Hi there, \(name)."
let finalGreeting = "\(greeting) How are you?"
1 Answer
Steve Hunter
57,712 PointsHi Nolan,
The last task wants you to use concatenation, not interpolation. So, add the two strings together with a + sign.
let name = "Steve"
let greeting = "Hi there, \(name)."
let finalGreeting = greeting + " How are you?"
The code challenge is expecting to see the 'addition' which is why your code is failing the tests. XCode's output will be looking correct, but it isn't just the output that matters in this challenge; the inputs provided to create the outputs are always just as important.
I hope that helps,
Steve.
Nolan Figueroa
3,533 PointsNolan Figueroa
3,533 PointsThanks for the response. I realized my misinterpretation after I posted this when I understood interpolation wasn't being requested. Guess I should pay more attention instead of trying to fly through these things haha. Again, thanks!
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsHey, no problem - as long as you got sorted!