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!

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

joseph veary
joseph veary
297 Points

I am stuck on Numbers challenge 2 of 3.

The question is "Next create a constant called price and assign it the value 9.99."

I assumed it was like a string so my answer was "let price = 9.99" Turns out that is wrong and I'm not sure what I have to do to fix it. Any advice will be helpful.

let price = 9.99

2 Answers

The line in your code sample is perfect, that is exactly how to create a constant with a value of 9.99.

I notice in your code sample there is only one line. There are supposed to be two lines of code in task 2. Is the first line of your code correct?

joseph veary
joseph veary
297 Points


You were absolutely right! I deleted the previous line and it wasn't registering that I had completed it. I have just started and so far I like the work. I may get lost again so don't be surprised if I message you with another question. Thank you for help :)

Glad I could help! Good luck and have fun with the course! (: