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 trialbill huggin
126 PointsHaving trouble w/ the println function. Not sure what I'm doing wrong. interpolate?
not sure what I'm doing wrong. Already confused....I think this lesson should be project influenced learning....For first timers, it's confusing as hell to know why we are doing things....the exercise should have a higher purpose. Also is the println function a literal command that is for a printer or just code to view in a console?
let language = "Swift"
println("Learning Swift \language)")
3 Answers
Max Hirsh
16,773 PointsSo to answer your question, yes, the print or println function is used in programming languages to print to the console. This allows you to see what your code is calculating or print text to the screen. Otherwise the computer would just do calculations without displaying anything.
kjvswift93
13,515 PointsIn your answer, you printed "Learning Swift Swift" instead of "Learning Swift".
let language = "Swift"
println("Learning \(language)")
bill huggin
126 Pointsthx! so the print function is just to display the output to a console? (and a console is your form factor display or just referring to the Xcode console?)
Max Hirsh
16,773 PointsYes, exactly. The console we're talking about xcode console in this case, which just appears on the bottom center in the main Xcode app, or in a separate partition on the right if you are in an Xcode playground. If you thought my answer was helpful, be sure to click the up arrow to the right of it so I can get points for participating in the forum. Thanks!