<human>:  Python functions to get contents of text files in a Python program.
<bot>: 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.