def covstr ( s ) : try : ret = int ( s ) except ValueError : ret = float ( s ) return ret
python change str to float
convert string to int or float .
def covstr(s):
  """ convert string to int or float. """
  try:
    ret = int(s)
  except ValueError:
    ret = float(s)
  return ret