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 (retired) Types Numbers

Julian Zuleta
Julian Zuleta
177 Points

let price: Double = 9.99 and my code look it like not right

let price: Double = 9.99 any sugestions ? I'm lost

let price: Double = 9.99

You shouldn't be receiving an error here. what error message are you getting?

3 Answers

Both of these answers are correct and will pass the challenge:

Answer explicitly stating the type.

let title: String = "A Dance with Dragons"
let price: Double = 9.99
let yearPublished: Int = 2011

Answer using type inference:

let title = "A Dance with Dragons"
let price = 9.99
let yearPublished = 2011

People I found the problem. You cant erase the previous line. Where it says to declare the title. It specifically says at the top to build on top of previous code. I did it. I worked perfect.