该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
求教,
共享那一章,按照书上说的写了个nester.py
>>> def print_lol(a_list):
for each_item in a_list:
if isinstance(each_item, list):
print_lol(each_item)
else:
print(each_item)
又创建了一个同名的文本文件。
然后又在nester.py中增加了文本注释
>>>***This is the*nester.py* module and it provides one function called print_lol()
which prints lists that may or may not include nested lists.***
def print_lol(the_list):
***This function takes one positional argument called *the_list*, which
is any Python list (of - possibly - nested lists). Each data item in the
provided list is (recursively) printed to the screen on its own line.***
for each_item in the_list:
if isinstance(each_item,list):
print_lol(each_item)
else:
print(each_item)
然后它要我在IDLE中加载并运行nester.py这个模块,但是没有告诉我如何“加载”,以及“运行”,然后我就傻了。
所以……如何加载和运行呢……