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 trialDonghyun Kim
1,295 PointsThere is nothing wrong but it is saying its wrong.
I do not see anything wrong with my code but treehouse says its wrong i copied and pasted it onto Xcode and it runs fine on xCode
// Enter your code below
let firstValue = 2
let secondValue = 4
let product = firstValue * secondValue
let output = "\("The product of") \(firstValue) \("times") \(secondValue) \("is") \(product)"
2 Answers
Zachary Kaufman
1,463 PointsHaha sorry for whatever reason when I posted the answer it deleted the backslash here is the correct code
Let output = "The product of (firstValue) times (secondValue) is (product)"
When I post this for some reason all the back slashes will be deleted. Please have a backslash before every () and that should be the correct answer
Zachary Kaufman
1,463 PointsDon't have () around The product of and around times and around is. I think that will let it pass. Having () around everything in strings looks choppy and unorganized which is why the grader is counting it wrong even though technically it is correct. I hope this helps good luck with your classes!
Donghyun Kim
1,295 PointsI proceeded to do so, but it still won't let me pass, I wonder what the problem is :(
Zachary Kaufman
1,463 PointsWould you mind sending me your updated code?
Donghyun Kim
1,295 Points// Enter your code below let firstValue = 2 let secondValue = 4
let product = firstValue * secondValue let output = " \"The product of" (firstValue) \"times" (secondValue) \"is" (product) "
sure here, like you said i took out the (), around the strings
Donghyun Kim
1,295 PointsDonghyun Kim
1,295 PointsThank you !
Zachary Kaufman
1,463 PointsZachary Kaufman
1,463 PointsNo problem good luck with your classes! :D have a good day