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 2.0 Basics Swift Types Recap: Swift Types

Swift 2.0 code challenge says I'm wrong. What is wrong?

let firstValue = 2016 let secondValue = 365 let product = "(firstValue) * (secondValue)" let output = "(firstValue) * (secondValue) * (product)"

This is my code.

let firstValue = 2016
let secondValue = 365
let product = "\(firstValue) * \(secondValue)"
let output = "\(firstValue) * \(secondValue) * \(product)"

2 Answers

Batt Seyhan
Batt Seyhan
1,946 Points

Hi Kevin,

you are almost there:

let firstValue = 10
let secondValue = 20

let product = firstValue * secondValue 

let output = "The product of \(firstValue) times \(secondValue) is \(product)"

you are trying to multipli firstValue and SecondValue with in the string, that will not work

let product = "(firstValue) * (secondValue)" let output = "(firstValue) * (secondValue) * (product)"

It does not work. It says, " Bummer! Make sure you are assigning the value obtaining by multiplying firstValue and secondValue to product." What does this mean? Please help. All answers are good enough to try.

Batt Seyhan
Batt Seyhan
1,946 Points

are you assigning firstValue * secoundValue to product?

         //like this
         let product = firstValue * secondValue