Simple Python Markov chain generator