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

Kristen Cordes
Kristen Cordes
807 Points

interpolation

I feel like I'm really close, but just can't quite get it. Please help

// Enter your code below let firstValue: Int = 12 let secondValue: Int = 10 let product = firstValue * secondValue let output = "The product of (firstValue), times (secondValue),is (product)"

types.swift
// Enter your code below
let firstValue: Int = 12
let secondValue: Int = 10
let product = firstValue * secondValue
let output = "The product of \(firstValue),
times \(secondValue),is \(product)"

1 Answer

If you are basing your code on this video @ 11:40 there are commas in the video because there are commas in the final string. In task 2 there are no commas. It should just be "The product of 12 times 10 is 120". You will also want to move this string to one line.

Kristen Cordes
Kristen Cordes
807 Points

Thank you!! After rewatching the videos a few times I did finally figure it out. Those darn commas were really messing me up. It is all about the syntax isn't it.?

Again....appreciate your help.