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 trial

iOS Swift Basics Swift Types Recap: Swift Types

Amir Fendi
PLUS
Amir Fendi
Courses Plus Student 584 Points

Hi there .... i might need some help here solving this quiz .... Thanks for your COOP and support.

let firstValue: Int = 656 let secondValue: Int = 565 let Value = firstValue + secondValue /* Second task*/ let product: Int = firstValue * secondValue let output = "The product of (firstValue) multiply by (secondValue) is (product)"

Trying to compile the above example but the compiler is giving me an error that i'm not meeting the required inquiry within the question .... would appreciate some help here.

Thanks

types.swift
// Enter your code below
let firstValue: Int = 656
let secondValue: Int = 565 
let Value = firstValue + secondValue 
/* Second task*/
let product: Int = firstValue * secondValue
let output = "The product of \(firstValue) multiply by \(secondValue) is \(product)"

2 Answers

andren
andren
28,558 Points

The problem is that these challenges are extremely picky about string output, your string needs to look exactly like the string they are requesting. Any difference at all will often get your code marked as wrong even if everything but the string itself is correct.

The issue in this case is that the string they are looking for is:

"The product of \(firstValue) times \(secondValue) is \(product)"

And the string you produce is:

"The product of \(firstValue) multiply by \(secondValue) is \(product)"

Notice that they use the word times between the firstValue and secondValue not multiply by like you do. If you change your string so that it looks identical to the one in my first example then your code will pass.

Amir Fendi
PLUS
Amir Fendi
Courses Plus Student 584 Points

wow !! that's something ! didn't know that the system runs that strict .... but i do appreciate your quick response and help .... ??