I am using below line in a loop in my code
importer = exporterslist.pop(0)
If exporterslist has no entries or it is null
, it returns error: IndexError: pop from empty list
. How can I bypass exporterslist with no entries in it?
One idea I can think of is if exporterslist is not null then importer = exporterslist.pop(0)
else get the next entry in the loop.
If the idea is correct, how to code it in python?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…