Hey there I tried making a loop for creating folders and files. According to me the program should work like this :
- create 1st folder and 1 file inside it.
- create 2nd folder and 1 file inside it
and it goes on..... What my program does is :
- create 1 file
- create folders
my program
import os,sys
di=("ab")
a=0
i=0
fi=open("az.txt","w")
def file():
for i in range(0,10):
fi.write(str(i))
def mk():
for a in range(0,10):
os.mkdir(di+str(a))
file()
mk()
please help
printstatements inside the various loops (make their strings unique) and follow the flow of the program.fileis a built-in Python function. You're overriding it, so you'll be using your function, but better rename it, to something likecreate_files.