摘要: 代码: >>> from collections import Iterator,Iterable >>> >>> >>> from collections import Iterator,Iterable >>> l = [1,2,3,4,5] >>> for x in l: ... print( 阅读全文
posted @ 2020-11-02 14:55 Richardo-M-Lu 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 需求: 某文件系统目录下有一系列文件: quickshort.c graph.py heap.java install.sh stack.cpp ... 编写程序给其中的所有.py和.sh结尾的文件加上用户可执行权限 思路: 使用str.startswith()和str.endswith()方法 ( 阅读全文
posted @ 2020-11-02 10:06 Richardo-M-Lu 阅读(116) 评论(0) 推荐(0) 编辑