i was wondering if there was a way to create 10 empty files in a a specific directory while using a loop in python. I need to create the files with the names test1.txt, test2.txt, all the way up to test10.txt. I am pretty new to python, so any help with this would be greatly appreciated. Here is what i am working with.
def createFiles()
lab3='/home/student/Lab3'
#Before creation of files
dir_list = os.listdir(lab3)
print("List of directories before creating files")
print(dir_list)
print()
with open('test1.text', 'w'):
pass
#After creation of files
dir_list=os.listdir(lab3)
print("Directory and files after file creation: ")
print(dir_list)