Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Swift 2.0 Basics Swift Types Recap: Swift Types

Riley Heckaman
Riley Heckaman
807 Points

I'm struggling to code the product/output question, if 1stvalue and 2nd value = 7 and 13, what is product and output?

let firstValue = 7 let secondValue = 13 let product = 91 let output = ( (firstValue) * (secondValue))

types.swift
let firstValue = 7
let secondValue = 13
let product = 91
let output = ( \(firstValue) * \(secondValue) )

2 Answers

Reed Carson
Reed Carson
8,306 Points

youre almost there. instead of hardcoding "product" as 91, use what you did in output. then in output just use interpolation to print the sentence its looking for.

Riley Heckaman
Riley Heckaman
807 Points

It asks to print the string "The product of 7 times 13 is 91"

but that isn't working when I type:

let output = "The product of 7 times 13 is 91"

I believe this is incorrect because constants don't require the "", no?

Riley Heckaman
Riley Heckaman
807 Points

Status: COMPLETE #gotit :)