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
Arman Stephens-Dabney457 Points
What am i doing wrong?
I declared my constants already and have identified my interpolated variable to print out the string.
// Enter your code below let name = Arman let greeting = Hi there, let interpolatedGreeting = "\(greeting) \(name)";
Alex KoumparosPython Development Techdegree Student 36,886 Points
Your first issue is in the following line:
let name = Arman
In Swift, strings need to be enclosed in double quotes, otherwise the Swift compiler will think you are referring to a variable or constant named
The next line has the same issue. After you fix that issue, you will note that this string is not consistent with what the question is asking for:
Set the value of
greetingto an interpolated string that combines "Hi there, " with the string stored in the name constant.
Even if your
greeting constant was a string, it wouldn't be an interpolated string. Your
greeting constant should contain the string literal
"Hi there, " combined with the contents of
name. That combination should be achieved by the use of string interpolation.
You should not have any other constants declared (so you should not have a constant named
Hope that clears everything up for you.