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 trialRayhan Miah
2,369 PointsWhats wrong with this code
let name = "Rayhan" let greeting = "Hi there," let interpolatedGreeting = "(greeting) (name)"
whats wrong with it
// Enter your code below
let name = "Rayhan"
let greeting = "Hi there,"
let interpolatedGreeting = "\(greeting) \(name)"
2 Answers
Greg Kaleka
39,021 PointsHi Rayhan,
You're coding correctly, but you should re-read the instructions .
The first task asks you to
Set the value of greeting to an interpolated string that combines "Hi there, " with the string stored in the name constant.
So in your case, you need to interpolate your name right in the greeting
string so that greeting
stores "Hi there, Rayhan."
Given the code you've written, I'm sure you know how to do this!
Cheers
-Greg
Rayhan Miah
2,369 PointsWOW thank you it worked
Ben Masel
2,004 PointsHi there Rayhan! All you forgot to do was concatenate interpolatedGreeting so interpolatedGreeting should really look like this:
let interpolatedGreeting = "(greeting)." + "How are you?"
hope this helps!
Ben Masel
2,004 PointsBen Masel
2,004 PointsIf it still doesn't work i know why, if that happens just comment on this page i and i will help!