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

Interpolation: Lesson 2 Quiz 2 question 2. Putting firstValue and secondValue as the product. Please help me...

The question directions state that that the string should say, "The product of 2 and 4 is 8." But when i put in the integers i used, it says it is wrong. I have tried every possible option I can think of, but to no avail...

types.swift
// Enter your code below
let firstValue = 10
let secondValue = 5
let product = 10 * 5
let output = "The product of firstValue times secondValue is 50"

1 Answer

Reed Carson
Reed Carson
8,306 Points

for your product constant, you need to be multiplying the first and second values, but youve hard coded them in as 5 and 10.

and in your output statement, dont forget to use interpolation for the product as well, rather than hard coding in 50.

Dont forget to use the correct interpolation syntax as well. Simply saying firstValue wont retrieve the correct value. The syntax is

let constant = "whatever"
let randomStatement = "This displays \(constant)."