human
What is a good Python code to delete a file if there is one.
assistant
Here is a Python code to delete a file if there is one

import os

def delete_file(file_name):
    """
    Delete file if exist in `file_name`.
    """
    if os.path.isfile(file_name):
        os.remove(file_name)

# Enter the file name
file_name = "/home/rosey/Desktop/file.txt"

# Calling the function
print((delete_file(file_name)))

#Example Output
# None

#Remember to inspect code for bugs.