Python | While Loop Quiz | Question 9

Last Updated :
Discuss
Comments

What does the following Python code do?

num = 10
while num > 0:
   if num % 2 == 0:
       print(num, end=" ")
   num -= 1
 

Prints even numbers in reverse order from 10 to 1.

Prints odd numbers in the range [1, 10].

Prints even numbers in the range [1, 10].

Raises a SyntaxError.

Share your thoughts in the comments