【第30讲课后练习】无法正确输出字符
本帖最后由 xiaofan1228 于 2020-2-22 17:49 编辑import os
all_file = os.listdir("E:\\Python_homework\\")
type_count = dict()
for each_file in all_file:
if os.path.isdir(each_file):
type_count.setdefault("Folder", 0)
type_count["Folder"] += 1
else:
ext = os.path.splitext(each_file)
type_count.setdefault(ext, 0)
type_count += 1
print(type_count)
for name, count in type_count.items():
print( "File type [%s]====>%d "% (name, count))
截图如下
求分析 你这个使用什么截屏的呀? 一个账号 发表于 2020-2-22 17:58
你这个使用什么截屏的呀?
就windows自带的。。。 一个账号 发表于 2020-2-22 17:58
你这个使用什么截屏的呀?
老哥帮忙看看这是啥情况!!!! xiaofan1228 发表于 2020-2-22 18:01
老哥帮忙看看这是啥情况!!!!
把题目帖上来 一个账号 发表于 2020-2-22 18:07
把题目帖上来
编写一个程序,统计当前目录下每个文件类型的文件数。。。。https://xxx.ilovefishc.com/forum/201404/07/194733ms9swmp1xorsap0z.png xiaofan1228 发表于 2020-2-22 18:25
编写一个程序,统计当前目录下每个文件类型的文件数。。。。
那个应该是一个没有后缀的文件
页:
[1]