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

Hi, I'm new here. Can we not move to the next lesson unless we get the challenge right? Also, where's the right answer

It's hard for complete beginners to get the Q&A correct and it takes forever to complete a lesson as you need to go back and forth to get the answer right. Thanks

println.swift
let language = "Learning"
var str = "Swift"
println ("\language \str")

3 Answers

Samuel Webb
Samuel Webb
25,370 Points

I can't give you too much background information on how it works since I don't know Swift, but I do have a grasp of a few programming languages so I was able to figure it out. Basically when you interpolate a constant into a string, you have to put the constant in parentheses so that Swift knows what you're trying to interpolate. Specifically for this challenge it also wasn't necessary to create the str variable. Your code should look like this to pass:

let language = "Swift"
println ("Learning \(language)")

Don't worry, after a while you kind of get used to the way they ask you questions on here. Sometimes it can be a little confusing on exactly what you're supposed to do at first. I assure you that you'll get the hang of it in no time though.

Thanks very much for a great explanation Samuel. This is not easy with no programing background.

Samuel Webb
Samuel Webb
25,370 Points

Understandable. I pretty much started my programming by learning on Treehouse and once you've learned the basics of multiple languages, the basics of the others become quite easy to learn since you already have a grasp of how it works.

Strange thing happened, I tried typing the code you gave several times and it still got rejected for some reason, I then copied and pasted the code and it was accepted. I'm sure I typed it in correctly. I don't know if anyone else had this issue. Thanks again.

Samuel Webb
Samuel Webb
25,370 Points

When you're in a challenge, quiz or even just a normal video, on the ride side of the screen there are two arrows pointing left and right. If you click the right arrow, it will move on to whatever is next. I'd suggest not using that to skip things you can't get correctly. Instead, I'd suggest watching the video again. If you still can't get the answer after watching the video, I would then suggest posting a thread in the forum asking for help. Make sure to be descriptive and show your code to make it easy for us to help you. Click the Markdown Cheatsheet link under the Add an Answer box for formatting tips.

Hi Samuel Thanks for your reply. I understand but I'm not sure this approach will work for me. Personally I think a course without solutions will prove too frustrating. I don't feel like watching something 20 times and sometimes it comes down to interpreting the question itself. Having solutions is very important in any course. Anyway, I'll see how this goes. In the code above, I watched the video 3 times and I don't know what's wrong with my code? Any tips are appreciated.