game of 10,000 in python