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 trialZeeshan Zahoor
102 PointsError says this: Bummer! You printed "Learning Swift", but you were supposed to print "Learning Swift".
Copy/Paste error message here, not sure what is the error:
Bummer! You printed "Learning Swift", but you were supposed to print "Learning Swift".
let language = "Swift"
var zstr : String = "Learning "
println("\(zstr) \(language)")
2 Answers
jcorum
71,830 PointsThe editor can be rather picky sometimes, and the error messages baffling, as in your case. But here's what it wants:
let language = "Swift"
println("Learning \(language)")
Your way works in Xcode, but not in the editor.
Michael Hulet
47,913 PointsYou don't have to use the 2nd variable, but when you do, you put in a 2nd space, which isn't supposed to be there. This code worked for me:
let language = "Swift"
println("Learning \(language)")
However, if you wanna do it with 2 variables, you just need to have to remove the space at the end of the 2nd variable, like this:
let language = "Swift"
// Notice the lack of a space at the end of this line
var zstr : String = "Learning"
println("\(zstr) \(language)")
Zeeshan Zahoor
102 PointsZeeshan Zahoor
102 PointsActually I didn't try it in Xcode but either way, I figured out the correct answer.. just worth mentioning to you guys.