def is_hex(value):
 try:
  int(value, 16)
  return True
 except (TypeError, ValueError):
  return False

def is_hex ( value ) : try : int ( value , 16 ) return True except ( TypeError , ValueError ) : return False
returns true if value is a hexidecimal string .