Question: How do I delete a file or folder?

Answer: 
Here is a robust function that uses both `os.remove` and `shutil.rmtree`:

```
def remove(path):
    """ param <path> could either be relative or absolute. """
    if os.path.isfile(path) or os.path.islink(path):
        os.remove(path)  # remove the file
    elif os.path.isdir(path):
        shutil.rmtree(path)  # remove dir and all contains
    else:
        raise ValueError("file {} is not a file or dir.".format(path))

```
I recommend using `subprocess` if writing a beautiful and readable code is your cup of tea:

```
import subprocess
subprocess.Popen("rm -r my_dir", shell=True)

```

And if you are not a software engineer, then maybe consider using Jupyter; you can simply type bash commands:

```
!rm -r my_dir

```

Traditionally, you use `shutil`:

```
import shutil
shutil.rmtree(my_dir) 

```