Write python code for a deleting all files
- User
Write python code for a deleting all files
Assistant
import os # Get the current working directory. cwd = os.getcwd() # Get a list of all the files in the current working directory. files = os.listdir(cwd) # Delete each file in the list. for file in files: os.remove(file) # Print a message to the user. print("All files have been deleted.")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.