Week 1 Unit 7: Self-test

22. October 2024

Question 1

What does the expression (x % 5 == 0) and (x % 7 == 0) mean?

Note: There are 2 correct answers to this question.


x is divisible by 5 or 7
x is divisible by either 5 or 7 (but not both)
x is divisible by 5 and divisible by 7
x is divisible by neither 5 nor 7
if x is equal to 105, then the expression is True

Question 2

If a is a Boolean variable, what is the result of the following expression?

week1 unit7 f2

Undefined
Depends on the value of a
True
False

< Previous unit | Next unit > | Course Overview