Python批量创建文件

刷题,创建多个文件

import os

for i in range(51, 101):
    res = "0" + str(i) + ".py"
    # print(type(res))
    open("%s" % res, "w+")

猜你喜欢

转载自blog.csdn.net/microease/article/details/86295766