fork download
  1. lst = [1, 2, 3, 4, 5, 6]
  2. for i, item in enumerate(lst):
  3. while i < 3:
  4. print (i, item)
  5. i += 1
  6. print ('---')
  7. for i in range(len(lst)):
  8. while i < 3:
  9. print (i, lst[i])
  10. i += 1
  11. print ('---')
  12. i = 0
  13. while i < len(lst):
  14. while i < 3:
  15. print (i, lst[i])
  16. i += 1
  17. i += 1
Success #stdin #stdout 0.09s 8912KB
stdin
Standard input is empty
stdout
(0, 1)
(1, 1)
(2, 1)
(1, 2)
(2, 2)
(2, 3)
---
(0, 1)
(1, 2)
(2, 3)
(1, 2)
(2, 3)
(2, 3)
---
(0, 1)
(1, 2)
(2, 3)