I managed to get the right syntax but don't know how. Can anyone explain?? Thanks.
Please post your code and a link to the exercise. Thank you.
Line 2 defines a function called
quarter which as its name implies, will quarter any number passed in to it. So if we pass an argument of 12 in our function call, the return value will be 3.
Line 7 introduces an if statement that has as a conditional, a compound expression:
- a function call expression (which yields a value)
- a modulo expression, which yields a value
- an identity expression which yields a Boolean
The function call runs first, followed by the modulo and finally the identity test. 3 % 3 is 0 so that expression will yield true. With the conditional fully evaluated, we can now take the true branch of the control flow structure.
Will make notes from that. Thanks a mil..