code: def number(input):
      
      
      try:
          return int(input)
      except (TypeError, ValueError):
          pass
      
      try:
          return float(input)
      except (TypeError, ValueError):
          raise ValueError("Unable to convert {0!r} to a number.".format(input))
docs: Convert the given input to a floating point or integer value.
      
      In cases of ambiguity, integers will be prefered to floating point.
      
      :param input: the value to convert to a number
      :type input: any
      
      :returns: converted integer value
      :rtype: float or int