This is what I have:
import os
names = ['Abby','Betty','Bella','Peter','Jack','Sonya']
file_path = rf'../database/{names}'
if os.path.exists(file_path) == True:
print('name folders exists')
else:
for name in names:
os.makedirs(os.path.join('../database', name))
I want the code to create the folders for each name in names list if they do not exist and print name folder exists if they already exist. But I keep getting a FileExistsError on the last line. Can someone tell me what I should change in the code to get it to work in the way I want it to?