def real_or_comp(str_rep):
  """ convert the string representation of a real or complex number into float or complex
  e.g. real_or_comp('1.5') -> 1.5, real_or_comp('(1.0,-1.0)') -> 1.0-1j*1.0
  Args:
    str_rep (str): string representation of a real or complex number
  Returns:
    complex/real: value of str_rep
  """
  val = None
  if str_rep.strip().startswith('('):
    ri_list = list(map(float,str_rep.replace('(','').replace(')','').split(',')))
    val = ri_list[0] + 1j*ri_list[1]
  else:
    val = float(str_rep)
  # end if
  return val