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 trialAftahar Miah
Courses Plus Student 246 PointsCant complete the challenge. Need help Please
I can't complete the challenge...Im new to all this
let language : string = "Swift"
var str : Learning
println( "str + language")
1 Answer
Chris Shaw
26,676 PointsHi Aftahar Miah,
You have a couple of problems with your code which are:
- you have given the
language
constant a type which isn't required by the challenge - you've created a new, but invalid variable called
str
, this isn't needed and can be omitted - you haven't used string interpolation as shown by Amit in the previous video
With that said the code you should have is as below.
let language = "Swift"
println("Learning \(language)")
And just so it makes sense, if you did want to create a variable called str
and assign it a type you need to use camel casing for String
and encapsulate Learning within quotes.
var str: String = "Learning"
Happy coding!
Thomas Oliver Bastable
Python Development Techdegree Graduate 29,026 PointsThomas Oliver Bastable
Python Development Techdegree Graduate 29,026 PointsCapitalised the S on 'String', Corrected the initialisation of str, Added interpolation to the string you're printing. Hope this helps!