我在代码中的循环中使用下面的行
importer = exporterslist.pop(0)
Run Code Online (Sandbox Code Playgroud)
如果exporterslist没有条目,或者它是null
,则返回error: IndexError: pop from empty list
.如何在没有条目的情况下绕过exporterslist?
我能想到的一个想法是,如果exporterslist不为null,则importer = exporterslist.pop(0)
获取循环中的下一个条目.如果想法是正确的,如何在python中编码?