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 trialMichael Bau
3,394 PointsIn the code challenge I get the message "Use of unresolved identifier"
Hi,
This message refers to the 'product' constant.
I am unsure as to how to determine the 'product'.
Do I write:
'a' * 'b' or '120' * '33' (the numbers I have used) or 'firstValue' * 'secondValue'
Which is correct?
My 'output' constant looks like this:
let output = "The product of, (firstValue), times, (secondValue), is, (product)"
Best regards
3 Answers
Kyle Johnson
33,528 PointsHi Michael,
It looks like you almost have it correct but you are missing one thing. You forgot to put the \ in front of your constants in the string. You also don't need those commas if you want to be grammatically correct. Your code should look like this:
let output = "The product of \(firstValue) times \(secondValue) is \(product)."
Michael Bau
3,394 PointsHi Kyle,
Thanks for your answer. I tried to write the string as you suggested but still get the same error. Could there be something with the earlier constants?
My 'product' constant looks like this = let product = a * b, is this correct?
By the way, I have yet to understand how to insert screenshots in a comment. How is this done?
Best regards, Michael
Michael Bau
3,394 PointsHi again,
I just realized that my 'product' constant was wrong. I should have typed 'firstValue' * 'secondValue' instead of 'a' * 'b'. My bad.
So, that combined with your suggested 'output' constant, did the trick. Thanks!
Best regards, Michael
Marlon Henry
6,885 PointsMarlon Henry
6,885 PointsSo we can see exactly what's going on...is there anyway you can show us your code?