def typedvalue(value):
 try:
  return int(value)
 except ValueError:
  pass
 try:
  return float(value)
 except ValueError:
  pass
 return value

def typedvalue ( value ) : try : return int ( value ) except ValueError : pass try : return float ( value ) except ValueError : pass return value
convert value to number whenever possible .