将1-100循环输出,并生成一个名为num.txt的文件python
num = open('num.txt','a') for i in range(1,101): print >> num , i num.close()