What will be the output of the following Python statement?

print(list(range(5, 0, -2)))
                        

Options

  • A. [5, 3, 1]
  • B. [5, 4, 3, 2, 1]
  • C. [5, 3]
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. [5, 3, 1]

Detailed Explanation

Explanation: The range starts at 5, decreases by 2 and stops before 0. The values are 5, 3 and 1.