Information Gain Python Code