WorksheetsBoolean Operators & Comparison Operators
Total questions: 11
Worksheet time: 6mins
What does the 'not' operator do in coding?
Repeats a loop
Turns 'yes' into 'no' and 'no' into 'yes'
Multiplies values
None of the above
If bananas[0].rotten() returns True, what will 'say not bananas[0].rotten()' print?
yes
no
true
false
What is the role of 'if' statements in coding?
They perform calculations
They check conditions to decide which code to execute
They print output
They store variables
Which of these is a unary operator?
and
or
not
==
Why can't the monkey catch green bananas in Coding Adventure?
Green bananas are for goats
Green bananas are too high
Green bananas are rotten
Green bananas do not exist
What will happen if you write: if not bananas[1].rotten() and not bananas[1].green()?
The monkey will go to the banana if it's neither rotten nor green.
The monkey will skip all bananas.
An error will occur.
The banana will disappear.
The not operator changes a value to its (a) .
The statement if not eatenBreakfast() will be true for someone who (a) eaten breakfast.
In coding, the not operator is called a (a) operator because it only takes one input.
In the statement if not banana.rotten(), the monkey will go to the banana only if it is (a) .
Another example of a unary operator that you've seen in Coding Adventure is the (a) sign, which turns a value into its negative.
