turing machine on python