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 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

types.swift
// 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)"