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 trialdlarre04
4,271 PointsWhat am I doing wrong?
I'm not able to get past this
// Enter your code below
let name = "Danielle"
let greeting = "Hi there"
let interpolatedgreeting = "\(greeting), \(name)"
2 Answers
Jason Anders
Treehouse Moderator 145,860 PointsHey there,
While your code is technically correct in syntax, it's not what the challenge is asking for.
Task one you have is correct with your name assigned to a constant named name
Task two only asks for one more constant named greeting
, but you also have a third constant? The interpolated string the challenge is looking for needs to be assigned only to the greeting
constant. So you need to delete the interpolatedGreeting
and do everything for the second task with only one line of code assigned to the constant greeting
.
Give it another go with that in mind, and remember challenges are very picky and extremely strict. So, you always need to pay very close attention to the instructions and never add more than what is asked.
Keep Coding! :)
andren
28,558 PointsThe challenge asks you to set the greeting variable to an interpolated string containing "Hi there, NAME", it does not ask you to create a separate interpolatedgreeting variable where you do the interpolation.
The solution to the first task looks like this:
let name = "Danielle"
let greeting = "Hi there, \(name)"
dlarre04
4,271 Pointsdlarre04
4,271 PointsThanks this was helpful