# Author:mologa
k = "ab"
for i in k:
with open('%s.txt'%i,'w') as f:
f.write("hello")
f.close()
这样就可以创建a.txt、b.txt、c.txt、d.txt
四个文件;
##### *知识点:
`open('%s.txt'%i,'w')`
# Author:mologa
k = "ab"
for i in k:
with open('%s.txt'%i,'w') as f:
f.write("hello")
f.close()
这样就可以创建a.txt、b.txt、c.txt、d.txt
四个文件;
##### *知识点:
`open('%s.txt'%i,'w')`