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

Robert Stringer
Robert Stringer
Courses Plus Student 3,171 Points

I'm having difficulty creating an interpolated string to express the final equation requested.

I've tried a few ways to put this together but can't seem to get past it.

// Enter your code below
let firstValue: Int = 249
let secondValue: Int = 349
let product = firstValue * secondValue
let output = "\(firstValue) * \(secondValue) \(product)"
Robert Stringer
Robert Stringer
Courses Plus Student 3,171 Points

it seems as though this one already got answered, I just didn't know where to look!

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

1 Answer

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

Hi there! You're doing fine and your code is functional. However, it's not producing the exact string they're asking for in the last line of the instructions. Your code is producing the string "249 * 349 86901". They want the string to be "The product of 249 times 349 is 86901." Take a look at the output line needed:

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

Note: when doing challenges that require a string to be returned or printed always double check for punctuation, spacing, and wording. If the challenge is failing and you believe it to be correct, chances are you've missed something in the string.

Hope this helps! :sparkles: