[Tutor] Loop in pre-defined blocks

Ek Esawi esawiek at gmail.com
Mon Jun 13 19:24:53 EDT 2016


OPS! This code now produces desired results. I suppose that this works for
smaller blocks. For larger blocks, it might be cumbersome. EK
b=[12, 20, 35]

for i in range(len(b)):
     if i==0:
          c=0
     elif i==2:
          c=24
     else:
          c=b[i-1]
     for j in range(c, b[i]):
         print(i+1,j+1)


More information about the Tutor mailing list