Welcome to the Treehouse Community
Looking to learn something new?
I've declared let name = "Courtney" but on the next line am I meant to let greeting = "Hey, there" ?
and then do I make it interpolated?
// Enter your code below let name = "Courtney" let greeting = "\"Hey There,", (name)"
First, you only need one string. Second, I don't see why the
\ is way in the front of the string. Huh? You heard, you need the
\ in front of the
(), not in front of the string!
Third, your string in general isn't the string the challenge wanted. The challenge wanted something like "Hi there, Courtney" but your string returns "Hey There, Courtney". Code challenges are very picky and will cause a Bummer! message if you don't do exactly what it says.
Anyway, this is the correct string that you should assign to
"Hi there, \(name)"
Jiri Janecek6,443 Points
You're almost there. First, you have way too many " there. You need just 2: "The left one starts the string and the right one ends it".
Now, if you want to add a variable/constant to an string, you do it like this: (nameOfVariable)
For example, if you have a constant named color with value "red" and you write such code "My favorite color is (color)", it will print out this: My favorite color is red
Tyler DotsonCourses Plus Student 1,740 Points
Alecander Davison, how do you had code into your comment