Embedded For Loop With No Data

rshepard at nospam.appl-ecosys.com rshepard at nospam.appl-ecosys.com
Fri Jul 6 00:03:59 CEST 2007

  Haven't found an answer to my question in the books and other docs I have
available, so I am asking here.

  I have three lists of data retrieved from database tables. I want to cycle
through all three lists using nested FOR loops. What is the behavior if
there are no data in the list used in the middle loop?


  for a in types:
      for b in subtypes:
          for c in details:
		do some processing

  Not every item in the 'types' list will have an associated 'subtype'. Does
the index ignore that loop and drop to the one nested beneath it?


More information about the Python-list mailing list