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

I don't get how you get this string "The product of 2 times 4 is 8". Assign this string to a constant named output.

I don't get how you get this string to read "The product of 2 times 4 is 8". Assign this string to a constant named output. It works fine in xcode, but I'm not passing the challenge.

types.swift
let firstValue: Int = 2
let secondValue: Int = 4
let product = firstValue * secondValue
let output: String = "The product ofΒ \(firstValue)Β times \(secondValue) is \(product)"

2 Answers

Michael Reining
Michael Reining
10,101 Points

Hi Anthony,

I don't see anything wrong with your code and your code snippet was accepted in the code challenge when I tried it.

let firstValue: Int = 2
let secondValue: Int = 4
let product = firstValue * secondValue
let output: String = "The product of \(firstValue) times \(secondValue) is \(product)"

I hope that helps,

Mike

PS: Thanks to the awesome resources on Team Treehouse, I launched my first app.

Now you can practice writing Swift code directly on your iPhone :-)

Code! Learn how to program with Swift

I tried my code again, and it passed instantaneously. I don't know what happened before. I swear at times there are characters we don't see. Sounds crazy, doesn't it?

Congratulations with your iPhone app! May I ask the name? I would love to produce a couple of apps myself, but no specific plans.

If you would like, my email is anthonyarnold77@gmail.com I would enjoy corresponding with an app developer especially for some pointers,.