What iterative statement should you use if you want to print the numbers 1, 2, and 3?

Automate Cybersecurity Tasks with Python | Weekly challenge 1 Quiz | 

What iterative statement should you use if you want to print the numbers 1, 2, and 3?

  • for i in range(1,3):
    print(i)
  • for i in [1, 2, 3]:
    print(i)
  • for i in [1,3]:
    print(i)
  • for i in range(0,3):
    print(i)

 

Leave a Comment