code: def autoconvert(string):
      
      for fn in (boolify, int, float):
          try:
              return fn(string)
          except ValueError:
              pass
      return string
docs: Try to convert variables into datatypes.