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 trial

iOS Swift Basics (retired) Types Printing Results

thibaut noah
thibaut noah
8,692 Points

Interpolate println statement

What is wrong with this challenge? Pretty sure my answer is correct, i don't see how it is not???

println.swift
let language = "Swift"
println("Learning " + language)
thibaut noah
thibaut noah
8,692 Points

Yeah 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

Julien Mayer
Julien Mayer
1,880 Points

No Problem!

Julien :)

Julien Mayer
Julien Mayer
1,880 Points

No Problem!

Julien :)

2 Answers

Julien Mayer
Julien Mayer
1,880 Points

Noah,

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

let language = "Swift" println("learning "/(langauge))