Home > OS >  How to make 80 folders using Python
How to make 80 folders using Python

Time:11-16

I want to make 79 folder in my drive and want folder name is a number 1 to 79. this is my code. I used Google colab

import os
for i in range(1,80):
  folder = "/content/drive/My Drive/project/Dataset"
  os.makedirs(folder[i])

Please Help. My code can be change if you have any thought.

CodePudding user response:

Use:

import os

folder = "/content/drive/My Drive/project/Dataset"
for i in range(1,80):
    os.mkdir(os.path.join(folder,str(i)))
  • Related