<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_file(self):
 """Check for file format and type """

        try:
            image_type = ".{0}".format(self.image.split(".")[1])
            if image_type not in self.file_format:
                print("Format: '{0}' not recognized. Use one of "
                      "them:\n{1}".format(self.image.split(".")[1],
                                          ", ".join(self.file_format)))
                raise SystemExit()
        except IndexError:
            print("slpkg: Error: Image file suffix missing")
            raise SystemExit()