-
Data Structures
-
Iteration
-
Mathematics
-
Files
-
Programming On A Machine
-
Exercises
Delete a file
We can delete a file using slightly different code.
In this case we need to use a function from the module called os
.
This module provides functions for working with the operating system.
import os
os.remove("names.txt")