Welcome to the Treehouse Community
Looking to learn something new?
John Henry Dale360 Points
I'm having trouble with the swift types quiz, can someone please chime in ?
I've tried to do what the instructions ask and can't seem to get a proper result. Specifically I'm not sure where / how the string assigned to output "The product of 2 times 4 is 8" is supposed to be declared
// Enter your code below let firstValue = 2 let secondValue = 4 let product = "\(firstValue) * \(secondValue)" let output: String = "The product of 2 times 4 is 8"
Tobias Helmrich31,601 Points
firstly you don't have to use interpolation when calculating the product, just multiply the two values. The problem with your output constant is that you're just writing the numbers inside of the String manually but you have to use String interpolation, like you did in the product constant, so that the output changes depending on the values.
This is a working example:
// Enter your code below let firstValue = 2 let secondValue = 4 let product = firstValue * secondValue let output: String = "The product of \(firstValue) times \(secondValue) is \(product)"
If you have further questions feel free to ask, good luck! :)