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 trialBrendan Prieto
2,061 Pointshow to create a constant called price and assign it the value 9.99
Need help
Brendan Prieto
2,061 PointsThanks Ed, That's what I thought but it's not working. I've contacted support
6 Answers
agreatdaytocode
24,757 PointsIt would be ...
let price = 9.99
Brendan Prieto
2,061 PointsThank you. Thats what I thought but it doesn't work.
Jabran Shakil
2,734 PointsHi Aaron, I figured it out. I forgot to remove the colon which isn't necessary when defining numbers I guess. Thank you.
agreatdaytocode
24,757 PointsBrendan make sure you have the first answer listed on the challenge as well. Your answer should look like this:
let title = "A Dance with Dragons"
let price = 9.99
Jabran Shakil
2,734 PointsI'm getting the same exact stupid error. I have everything typed out exactly like you have it. I thought I was doing it right, and I am but the thing keeps saying Somethings not right. Is it because I'm doing this code challenge on the teamtreehouse app? This is getting frustrating, I always have these problems with the treehouse editor.
Jabran Shakil
2,734 PointsAny help here? It won't let me move into the next part of the code challenge. Thank you.
agreatdaytocode
24,757 PointsHello Jabran, can you show me your code please?
Edwin Capel
2,232 PointsEdwin Capel
2,232 Pointsassuming you're learning the Swift language
constants are defined by "let"
so for your question :
let price = 9.99