<human>:  Can you show me a Python function to determine if string is a file with file extension.
<bot>: Here is a Python function to determine if string is a file with file extension

import os

def is_file_with_extension(filename):
  """
  Determine if string is file with file extension.
  """
  return filename.endswith('.txt')

# Enter the filename
filename = 'test.txt'

# Calling the function
print((is_file_with_extension(filename)))

#Example Output
# True

#Remember to inspect code for bugs.