input: Write a python function to read all '.txt' files in a directory and concatenate their contents.
  assert read_and_concatenate('/path/to/directory') == 'Content of file1Content of file2'
  assert read_and_concatenate('/another/path/to/directory') == 'File1ContentFile2Content'
  assert read_and_concatenate('/empty/directory') == ''
output: def read_and_concatenate(directory):
      import os
      contents = []
      for filename in os.listdir(directory):
          if filename.endswith('.txt'):
              with open(os.path.join(directory, filename), 'r') as file:
                  contents.append(file.read())
      return ''.join(contents)