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

help i dont get printing results challenge

The question asks: 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).

so i got let language = "Swift" but do I have to do the parentheses thing with the backword slash?

in order to print you need to tell the computer to print. '''println()''' this tells the computer to "print" whats inside "()" For example ....'''println("Swift is Awesome")'''

3 Answers

Hi Shannon,

You do need to use interpolation for this challenge, if you remember back to the earlier Swift videos Amit talking about interpolation about. See the below example.

let myConstant = "Something"
println("The variable 'myConstant' is a constant and contains the value \(myConstant)")

String interpolation like the one Chris Upjohn mentioned is good too use because it makes the text (the code) easy to read. Its even better if you choose good names for your constants. Keep struggeling! :D

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). help how do i solve this question ?