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 trialJason Demetillo
428 PointsTrying to create a constant called price and assign it the value 9.99.
I have it down as let price = "9.99" and it's saying its wrong, a bit confused as I thought I'm assigning that value?
let price = "9.99"
5 Answers
Nick Janes
5,487 PointsIs the var str = "price" supposed to be there? Shouldn't your answer just be:
let price = 9.99
Nick Janes
5,487 PointsThey want you to assign it the value 9.99 as a float, but you're trying to assign it as a String.
This is the answer they were looking for. Notice how I removed the quotation marks.
let price = 9.99
Jason Demetillo
428 Pointsahhhh makes sense
Nick Janes
5,487 PointsIf you have any more questions feel free to tag me by putting @NickJanes and clicking on my name!
Jason Demetillo
428 PointsNick Janes Hey Nick I have this down and it's still telling me I'm wrong?
var str = "price"
let price = 9.99
Nick Janes
5,487 PointsWhat is the question you're trying to answer?
Jason Demetillo
428 PointsNick Janes it's asking Next create a constant called price and assign it the value 9.99.
Jason Demetillo
428 PointsAgh I Got it Nick Janes ...it needed the previous code from before to make it complete, thanks so much again
var str = "title" let title = "A Dance with Dragons"
let price = 9.99
Nick Janes
5,487 PointsAhh you beat me to it!
Jason Demetillo
428 PointsJason Demetillo
428 PointsThat's what I thought, but it still says it couldn't compile it...
Nick Janes
5,487 PointsNick Janes
5,487 PointsI think I've figured it out! You removed the line from the first challenge. This should work: