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 trialthibaut noah
8,692 PointsInterpolate println statement
What is wrong with this challenge? Pretty sure my answer is correct, i don't see how it is not???
let language = "Swift"
println("Learning " + language)
Julien Mayer
1,880 PointsNo Problem!
Julien :)
Julien Mayer
1,880 PointsNo Problem!
Julien :)
2 Answers
Julien Mayer
1,880 PointsNoah,
it looks like you are interpolating incorrectly. The ,", should be around the entire thing you are trying to print.
Also, you are just adding the constant to the println statement, String Interpolation is achieved by doing (language). Interpolation will make it so that if the variable or constants were to be changed, the printed statement would change with it.
Therefore, correct way to interpolate would be to have the following typed out:
println ("Learning (language)")
*note that the slash is a backslash, not a forward slash.
I hope this helped to clear things up for you!
Julien
Sidharth Kaushik
3,431 Pointslet language = "Swift" println("learning "/(langauge))
thibaut noah
8,692 Pointsthibaut noah
8,692 PointsYeah i was following this video : https://teamtreehouse.com/library/swift-basics/types/printing-results syntax at 4min30. Since i'm familiar with programming i fast forward the vidz to get a quick look on syntax, didn't see he changed the syntax just after super quickly T_T Thanks for the answer