Ответ:

with open(‘INPUT.TXT’) as file:

   read_file = file.readline().strip()

   if read_file[3] == ‘=’:

       if read_file[1] == ‘+’:

           number_x = int(read_file[-1]) — int(read_file[2])

       elif read_file[1] == «-«:

           number_x = int(read_file[0]) — int(read_file[-1])

with open(‘OUTPUT.TXT’, ‘w’) as write_file:

   write_file.write(str(number_x))