Exam4Training

if ???

What would you insert instead of so that the program checks for even numbers?

if ???:

print(‘x is an even number’)
A . x % x == 0
B. x % 1 == 2
C. x % 2 == 0
D. x % ‘even’ == True
E. x % 2 == 1

Answer: C

Explanation:

Topics: if modulus operator equal to operator

Try it yourself:

x = 4

if x % 2 == 0:

print(‘x is an even number’) # x is an even number

Every number that divided by two does not leave a rest is even.

Exit mobile version