214k views
1 vote
What is the output?

x = 6 % 2
if x == 1:
print("ONE")
else:
print("TWO")

User Ayazmon
by
7.4k points

1 Answer

2 votes

Answer:

TWO

Step-by-step explanation:

Modulus (%) provides the remainder of division. Since 6/2 = 3 with no remainder, the remainder is zero. 6 % 2 is equal to zero.

since x is zero, the conditional statement is false and TWO is printed

User Manuel Eberl
by
7.9k points