human
how to get contents of text file in.
assistant
Here is a Python function to get contents of a text file

import os

def get_contents(filename):
    """Get contents of text file"""
    with open(filename, 'r') as f:
        return f.read()

# Enter the file name
file_name = 'test.txt'

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

#Example Output
# This is a test

#Remember to inspect code for bugs.