Menace The Machine Educable Nots and Crosses Engine shows how machine learning can work. Start in tic_tac_toe.py and work your way through it from there. Good Luck!