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!
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 trial
David Hutton126 Points
I don't understand what i am doing wrong, I am trying to do an interpolated greeting code, and it won't work.
below is what i typed:
let name = "billy bob"
let greeting = "Hi there ,"
let interpolatedGreeting = "(greeting), (name)"
i followed the video to perfection i thought...but I'm missing something but i don't know what.
// Enter your code below let name = "David Hutton" let greeting = "Hi there ," let interpolatedGreeting = "\(greeting), \(name)"
Antonio Montalvo10,549 Points
let interpolatedGreeting = "(greeting) (name)"
No coma after greeting in: let interpolatedGreeting = "(greeting), (name)"
Jason AndersTreehouse Moderator 145,854 Points
For the first task, you've seemed to take it a bit farther and made it more complicated than what the challenge is asking for. Basically, it wants you to create a constant with your name as the value, which you've done correctly. Then it wants you to use string interpolation assigned to the constant
greeting and using the constant that has your name, create the output "Hi there, David Hutton."
So, you're kind of on the right track, but you're
greeting variable is not producing the right out come. You need to interpolate your
name constant into the said constant.
You have to delete the constant
interpolatedGreeting that you created and introduce that into the
// Enter your code below let name = "David Hutton" let greeting = "Hi there , \(name)."
Hope that makes sense. Keep coding!