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 trialmark hengstebeck
1,119 PointsTask 1 of 2: // Task 2 - Enter your code below let isGreater = someOperation =< anotherOperation
I do not understand the question for task 2 of 2. Can anyone explain this?
// Enter your code below
let value = 200
let divisor = 5
let someOperation = 20 + 400 % 10 / 2 - 15
let anotherOperation = 52 * 27 % 200 / 2 + 5
// Task 1 - Enter your code below
let result = 200 % 5
let isPerfectMultiple = 0 == 0
// Task 2 - Enter your code below
let isGreater = someOperation =< anotherOperation
3 Answers
andren
28,558 PointsYour code for step 2 is pretty much correct with the exception that you have an error in your greater than or equal to sign. The greater than or equal sign is ">=" not "=<". If you fix that mistake then you'll be able to pass task two.
Though I would also like to note that your solution for step 1 is not entirely correct, the challenge wants you to use the variables that already exist in the project to reference the various values, not to hard code them in the program by typing the numbers in directly like you have done. So the solution should look like this:
let result = value % divisor
let isPerfectMultiple = result == 0
In a real world program there is a big difference between referencing a variable (whose value might change over the runtime of the program) and hard coding in a number that will never change no matter what happens in the program, even though both solutions technically work for this simple exercise.
mark hengstebeck
1,119 PointsHi Andren, That's it! Thanks, Mark
mark hengstebeck
1,119 PointsHi Christopher, That's it! I see it works with parentheses or without parentheses on task 2 of 2. Thanks, Mark
Christopher Nowack
2,468 PointsChristopher Nowack
2,468 Pointslet isGreater = (someOperation >= anotherOperation)