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

aj picard
aj picard
1,258 Points

Wouldn't the answer be: let output = "The product of 7 times 13 is 91" ?

Confused what you guys are asking me to do.

types.swift
// Enter your code below

let firstValue = 7
let secondValue = 13
let product = firstValue * secondValue 
let output = "The product of 7 times 13 is 91"
Chuck Underwood
Chuck Underwood
22,751 Points

The answer is looking for String Interpolation. You have output built with just a String.

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

Do you want to have to change the value of firstValue in both places or do you want to make the code work for you?

harshil bhatt
harshil bhatt
Pro Student 2,722 Points

no your answer is correct but the program wants you to get the value of first value, second , and the product the program thinks that output has only string no int which you dont want to give try this

let firstValue = 7 let secondValue = 13 let product = firstValue * secondValue let output = "The product of (firstValue) times (secondValue) is (product)" // this way it knows you are asking the value of the given constant