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 trialLouis ship
2,407 PointsProblems with the code challenges
Part two of the code challenges it seems I am doing something wrong but I don't know what
In this code challenge the issue is not the first part of the challenge but rather the second part. At that the challenge ask me to
Question:
input mevol is equal to 16 octal
Link:
http://teamtreehouse.com/library/creating-numbers-part-2
My code:
var mevol = 012;
Error:
It tells me this "Bummer! Please try again. Correct octal literals are declared like: var o = 021;
4 Answers
James Barnett
39,199 PointsYour syntax is good. 012 is 10 in decimal, what you need to do is figure out what 16 is in octal.
terrymartin
2,343 PointsIt's 018, but
var mevol = 018;
just returns an error message
Bummer! Please try again. Correct octal literals are declared like: <code>var o = 021;</code>
James Barnett
39,199 PointsTerry Martin - That's because 018 is not 16 in octal.
You need to convert decimal 16 into its octal equivalent. You can convert between octal and decimal by hand but that's not really necessary just use this octal-to-decimal converter
Louis ship
2,407 PointsSorry let me do that
Louis ship
2,407 Pointshttp://teamtreehouse.com/library/creating-numbers-part-2
In this code challenge the issue is not the first part of the challenge but rather the second part. At that the challenge ask me to input mevol is equal to 16 octal so i input var mevol = 012; It tells me this "Bummer! Please try again. Correct octal literals are declared like: <code>var o = 021;</code>"
Louis ship
2,407 PointsI am sorry this is me being an idiot. Thank you for your help James I will look at the code more closely next time
James Barnett
39,199 PointsJames Barnett
39,199 PointsIt's hard for us to know what issue you are having if you don't show us your code. For some tips on how to do that, check out the tips for asking questions video located in the right hand sidebar.
Also without a link to the code challenge you are having issues with someone would have guess which one it is, to be able to test out their solution.