Getting error tried so many times my code gives expected results but still fails when submitting:
Failed test case: testing/cats subdirectory was not found. And also fails other directory test here is my code:
def create_train_test_dirs(root_path):
"""
Creates directories for the train and test sets
Args:
root_path (string) - the base directory path to create subdirectories from
Returns:
None
"""
### START CODE HERE
# HINT:
# Use os.makedirs to create your directories with intermediate subdirectories
# Don't hardcode the paths. Use os.path.join to append the new directories to the root_path parameter
try:
os.mkdir(root_path)
os.mkdir(root_path + '/training')
os.mkdir(root_path + '/testing')
os.mkdir(root_path + '/training/cats')
os.mkdir(root_path + '/training/dogs')
os.mkdir(root_path + '/testing/cats')
os.mkdir(root_path + '/testing/dogs')
except OSError:
pass