To delete a file we do:
os.remove([file_name])
file_name is a string hence should come in inverted commas
Using os.remove () method you can remove file
import osos.remove(“demofile.txt”)
To delete a file first need to import: import osthen remove function of os will remove the fileexample:import osos.remove(“filename.txt”)