head first python第二版与第一版区别 |
您所在的位置:网站首页 › python第2版和第3版有什么区别 › head first python第二版与第一版区别 |
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 求教, 共享那一章,按照书上说的写了个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这个模块,但是没有告诉我如何“加载”,以及“运行”,然后我就傻了。 所以……如何加载和运行呢…… |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |