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

Daniel Kelly
Daniel Kelly
6,315 Points

let output = "The product of \(firstValue) times \(secondValue) = \(product)" Any idea why this is not being accepted?

let firstValue = 10

let secondValue = 20

let product = firstValue * secondValue

let output = "The product of (firstValue) times (secondValue) = (product)"

This seems to do exactly what is asked - but it's not being accepted. Any suggestions?

types.swift
// Enter your code below

let firstValue = 10

let secondValue = 20

let product = firstValue * secondValue

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

1 Answer

andren
andren
28,558 Points

It's not accepted because the challenge checker is extremely picky about text output, when you are asked to print a certain message you usually have to print it exactly as the challenge asks you to, using the exact words and punctuation that is provided.

In this instance the problem is that the challenge asks you to print out a message that reads: "The product of firstValue times secondValue is product" notice that there is an "is" between the second value and the product, rather than an equals sign, that difference is what is making the challenge checker reject your code.

Daniel Kelly
Daniel Kelly
6,315 Points

Thanks for the help! That worked! I skipped this challenge a while ago, and it's just been sitting, annoyingly unfinished in my track.

Thanks again.