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

Challenge task 1 of 1 iOS printing "Learning Swift"

Can't figure it out. I don't know why it won't work :-/

println.swift
let language = "Swift"
println("Learning" + language)

3 Answers

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

Hi, Darin Wilson ,

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

This challenge is very specific here, it's asking you to use string interpolation to insert the value of language constant to the print string, what you are doing in your code is string concatenation, by combining two string together using the +.

What you're doing isn't wrong, and it gets the same result either way, but ultimately, string concatenation isn't what this challenge is looking for.

let language = "Swift"
println("Learning \(language)")  // string interpolation
Katherine Duncan-Welke
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Katherine Duncan-Welke
iOS Development with Swift Techdegree Graduate 33,030 Points

Try adding a space after learning, inside of the quotation marks. It might not be passing because that space is missing, so it's printing out LearningSwift instead of Learning Swift.

Will not accept it :-/

println("Learning " + language)