我是编程新手,但我已经阅读过 Java、C++、Javascript、PHP 的教程,但从未遇到过这样的事情。你能解释一下这段代码吗,尤其是isinstance
for each_item in movies:
if isinstance(each_item, list):
for nested_item in each_item:
if isinstance(nested_item, list):
for deeper_item in nested_item:
print(deeper_item)
else:
print(nested_item)
else:
print(each_item)