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 trialSalaam Hill
Courses Plus Student 892 PointsSee Any Errors
I am not sure what I am doing wrong here. The error says that I need to make sure the constant greeting is interpolated. I believed I had done so.
// Enter your code below
let name = "Salaam"
let greeting = "Hi there"
let greetingPerson = greeting + "," + name
let interpolatedGreeting = "\(greeting)"
let interpolatedGreetingPerson = "\(greeting)\(name)"
2 Answers
miikis
44,957 PointsHi Salaam,
It's not letting you pass the Challenge because you're creating too many variables that were not requested. In the first part of the Challenge, name
should contain any string you like — such as your name — but greeting
is supposed to contain a string value corresponding to, "Hi there, Salaam". The means of combining these two strings — for this first part of the Challenge — is Interpolation.
For the second part of the Challenge, you are to concatenate the value you already have in greeting
with the string, ". How are you?" This concatenation is then to be stored in a constant named finalGreeting
.
The instructions are usually explicit in these Challenges for a reason; if you don't follow them to the letter, the answer checker will simply not let you pass. But, if you fix the above concerns, the Challenge should let you pass :)
Salaam Hill
Courses Plus Student 892 PointsOn another note. I just downloaded Xcode on my MacBook Pro but I can't figure out how to get the results screen to the right to be displayed. Any suggestions?
Salaam Hill
Courses Plus Student 892 PointsSalaam Hill
Courses Plus Student 892 PointsThank you very much for your help, I appreciate it!