A

Admin • 832.27K Points
Coach

Q. What is the output of this code snippet?

Code:
print(list(range(1, 10, 3)))
  • (A) [1, 2, 3, 4, 5, 6, 7, 8, 9]
  • (B) [1, 4, 7]
  • (C) [3, 6, 9]
  • (D) [1, 3, 6, 9]
  • Correct Answer - Option(B)
  • Views: 20
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

`range(1, 10, 3)` starts at 1, goes up to 9 with step 3.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.