write one thousand files with "giusti i told you so" inside in python

main.py
for i in range(1000):
    with open(f'file_{i}.txt', 'w') as f:
        f.write('giusti i told you so')
104 chars
4 lines

In the code above, we are using a for loop to iterate 1000 times, creating and writing to a file with a unique file name for each iteration. The file name will be in the format file_0.txt, file_1.txt, etc. The with statement ensures that the file is automatically closed after the write operation completes.

gistlibby LogSnag