def pair_strings_sum_formatter ( a , b ) : if b [ : 1 ] == "-" : return "{0} - {1}" . format ( a , b [ 1 : ] ) return "{0} + {1}" . format ( a , b )
how to combine two number strings in python
Formats the sum of a and b .
def pair_strings_sum_formatter(a, b):
  """
  Formats the sum of a and b.

  Note
  ----
  Both inputs are numbers already converted to strings.

  """
  if b[:1] == "-":
    return "{0} - {1}".format(a, b[1:])
  return "{0} + {1}".format(a, b)