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 trialBlanche Discipulo
Courses Plus Student 96 PointsI can’t seem to figure out what’s wrong with my code. help please
What is the main mistake in the declaration?
// Enter your code below
let name = " Blanche."
let greeting = " Hi there,"
let interpolatedGreeting = "\(greeting),\(name)
"
1 Answer
Margarita Garmutė
2,136 PointsHi,
in the challenge they asking you create just two constants. You created three. So let greeting constant should contain "Hi there" and the name. So you did everything correct but need to change.
Chloé Claes
19,451 PointsChloé Claes
19,451 PointsQuick glance: Syntax depends a bit on what language your writing in.
String interpolation is a way to construct a new String value from a mix of constants, variables, literals, and expressions by including their values inside a string literal. You can use string interpolation in both single-line and multiline string literals. Each item that you insert into the string literal is wrapped in a pair of parentheses, prefixed by a backslash (\):