【发布时间】:2014-04-28 16:02:41
【问题描述】:
我正在尝试为一年中的每一天创建一个文件,我想我会为此使用while 或for。但它似乎不起作用,因为我正在混合数字和字母。
def CreateFile():
date = 101
#this is supposed to be 0101 (first of januar, but since i can't start with a 0 this had to be the other option)
while date <= 131:
name = (date)+'.txt'
date += 1
CreateFile()
【问题讨论】:
标签: python for-loop python-3.x while-loop