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

sadik salad
sadik salad
1,916 Points

constant errorr

the question was Given the constant named language, write a println statement which will print the following string: "Learning Swift". (Remember to use the language constant within the string you pass to your println statement). and i wrote it like this println ("Learning Swift"+language)

Robert Bojor
Robert Bojor
Courses Plus Student 29,439 Points

You could also use println while escaping the variable inside the double quotes.

println("Learning \(language)")

4 Answers

why this statement not work for me ?

println("Learning " + language)

println("Learning (language)") worked but the other one didnt work.

Chris Atlas
Chris Atlas
2,038 Points

I believe it has to do with printing a value (+) or printing a line (println)