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

Format Not Right?

For some reason when I put in my code, it tells me to check my format, but I'm 100% that i got the right format for my constant output. Here's my code, what did I do wrong?

// Enter your code below let firstValue = 32 let secondValue = 12 let product = firstValue * secondValue let output = "(firstValue),(secondValue),(product)"

types.swift
// Enter your code below
let firstValue = 32
let secondValue = 12
let product = firstValue * secondValue
let output = "\(firstValue),\(secondValue),\(product)"

1 Answer

Magnus Hållberg
Magnus Hållberg
17,232 Points

There is nothing wrong in your code, its just that the challenge expects you to include the exact text for the string, like this.

// Enter your code below
let firstValue = 32
let secondValue = 12
let product = firstValue * secondValue
let output = "The product of \(firstValue) times \(secondValue) is \(product)"

Thank You!