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

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.

numbers.swift
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

Sara,

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! (: