Menu
Coddy logo textTech

Delete

Lesson 7 of 12 in Coddy's File Handling in Python course.

Sometimes you want to delete files using Python, for that we use the os library.

For example, to delete a file named a.txt:

import os
os.remove('a.txt')
challenge icon

Challenge

Easy

You are given a file named deleteme.txt, delete it!

Try it yourself

# Write code here

All lessons in File Handling in Python