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

The answer is wrong

When i put in: println("Learing " + language), it says I am wrong

println.swift
let language = "Swift"

I tried and tried

6 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

no, the answer is not wrong.

  • your spelling of the word Learing is a typo
  • language should be \(language), (this is called string interpolation) and should be placed inside the ""
println("Learning \(language)")

can you explain it to me?

Chris Shaw
Chris Shaw
26,676 Points

This challenge expects interpolation which is what's shown in William Li' answer as that is what was discussed earlier on in the course, what you attempted was concatenation which is also correct but not what the challenge is expecting.

William Li
William Li
Courses Plus Student 26,868 Points

I explained what you've done wrong in my answer, still feeling confused?

yes

No No you doing it all wrong it just the spelling is wrong. You put learning swift.

no i didn't

What's println

That's a typo

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Well, Krish, I don't argue that the output is the same. However, this question is asking

(Remember to use the language constant within the string you pass to your println statement).

Unless you do what the challenge is asking for, you don't get pass.

but william i did

print, prints it onto assistant editor println, does the same thing but the next print you do is on another line