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

This is a beginners course so please copy and paste me the answer I'm new thx

help please I really need help I spent like 30 mins on this probem

// Enter your code below
let firstValue: Int = 2
let secondValue: Int = 3
let product = 2 * 3
let output = product

1 Answer

Jeff McDivitt
Jeff McDivitt
23,970 Points

Copy and pasting you the answer will not teach you how to solve the problems. Programming is all about solving a problem. Just providing answers defeats the purpose of the treehouse community. I will however assist you with he answer by explaining how you break down the task.

// Enter your code below

//THis part is correct; however, you do not need to specify Int and this could be written like below
//let firstValue = 2
//let secondValue = 3
let firstValue: Int = 2
let secondValue: Int = 3
//For this part you would use the variables that you declared instead of the numbes
let product = firstValue * secondValue
//You then need to use string interpolation to produce the sentence that the task asks for
//You are inputting you variables into the sentence
let output = "The product of \(firstValue) times \(secondValue) is \(product)"