In this example we will show how to delete an entire folder in Python.
Source Code
import os
os.rmdir("del-folder")
Output:
If the folder exists, delete it without prompting.
If the folder does not exist, a 'FileNotFoundError' error is thrown.