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 trialKjersti Barstad Strand
3,142 PointsWhat is wrong? xcode says itΒ΄s correct.
let name = "Kjersti" let greeting = "Hi there" let interpolatedGreeting = "(greeting), (name)."
// Enter your code below
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! The code used must conform to the specifications of the challenge. For step one the challenge explicitly asks for an interpolated string to be assigned into the constant greeting
. The challenge also does not ask for anything to be printed. You've implemented a new constant which they haven't asked for in interpolatedGreeting
. Here is your modified code for step 1:
let name = "Kjersti"
let greeting = "Hi there, \(name)"
Hope this helps!
Sarthak Kedia
5,347 PointsYou just need to add backslashes ( \ ) in your code:
let name = "Kjersti"
let greeting = "Hi there"
let interpolatedGreeting = "\(greeting), \(name)"
print(interpolatedGreeting)
This will print : "Hi there Kjersti"
Hope that helps. :-)