Stop manually keeping track of count
and use the results of range
:
first_num = 16
folder_count = 143
base_path = r"C:\Users\joshuarb\Desktop\Organized_Images"
for folder_num in range(first_num, first_num + folder_count):
os.makedirs(os.path.join(base_path, "IMG"+str(folder_num).zfill(4)))