i got problem when i set a global variable in `main()` is always return `None` value

in `main()` i set global global variable like this:

```
def main():
    dir_path = 'None'

```

then i call function `create_directory_method` and try print the output of `dir_path`:

```
def create_directory_method(model_dir_name, i, params):
    if not os.path.exists('output/' + str(model_dir_name)):
         os.makedirs('output/' + str(model_dir_name))

x = i+1
if not os.path.exists('output/' + str(model_dir_name) + '/Data-Clone-' + str(x)):
    os.makedirs('output/' + str(model_dir_name) + '/Data-Clone-' + str(x))
with open('output/' + str(model_dir_name) + '/Data-Clone-' + str(x) + '/hyperparams.json','w') as f:
    json.dump(params, f)  
directory_path = 'output/' + str(model_dir_name) + '/Data-Clone-' + str(x)
global dir_path
dir_path = directory_path
print("path ", dir_path)
return dir_path

```

the value of `dir_path` on function is:

```
('path ', 'output/GNB/Data-Clone-1')

```

and in the `main()` i try to print `dir_path` value :

```
    print('test', dir_path)

```

but the value is always 

```
('test', 'None')

```

Is something wrong with my code?