<human>:  Can you show me a Python function to check if a binary file is a binary.
<bot>: Here is a Python function to check if a binary file is a binary

import os

def check_binary(filename):
  """
  Check if the given file is a binary file.
  """
  if not filename.endswith('.bin'):
    return False
  else:
    return True

# Enter the file
filename = "test.bin"

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

#Example Output
# True

#Remember to inspect code for bugs.