Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Eric villalobos938 Points
this is still not the correct code, after i am convinced it is correct it is not. i need the exact code
https://teamtreehouse.com/library/swift-3-basics/swift-types/recap-swift-types what is the exact code for this task? i am convinced my code is correct, and can not find the error in my code.
// Enter your code below let firstValue: Int = 2001 let secondValue: Int = 2002 let product = "firstValue * secondValue" let output = "The product of \(firstValue) times \(secondValue) = \(product)"
let product = "firstValue * secondValue" // This is a string! // It needs to be... let product = firstValue * secondValue
In addition to the problem that aidenmitchell has pointed out you also have an issue in your last line of code with regard to the task instructions. Namely that your string does not match the structure of the example string the instructions provide to the letter.
The example string is "The product of 2 times 4 is 8" notice the use of "is" rather than an equal sign which is what you are using in your string.
The complete answer to this challenge looks like this:
// Task 1 let firstValue: Int = 2002 let secondValue: Int = 2003 // Task 2 let product = firstValue * secondValue let output = "The product of \(firstValue) times \(secondValue) is \(product)"
Also please try to not create so many duplicate posts, especially without checking if the previous post has already been answered. This is in fact the second time I have posted this code for you, as I already left an answer on your previous post.
I'm having a problem with the code challenge. im putting in everything right but it won't take my code. help please!!