human
Give me a Python function to get the file extension in Python.
assistant
Here is a Python function to get the file extension in Python

import os

def get_file_extension(file_path):
        """
        Return the file extension of a file path.

        :param file_path: The file path.
        :return: The file extension.
        """

        return os.path.splitext(file_path)[1]

# Enter the file path
file_path = "/home/rosey/Desktop/myfile.txt"

# Calling the function
print((get_file_extension(file_path)))

#Example Output
# .txt

#Remember to inspect code for bugs.