Metropolis Hastings Algorithm Python Code For Snake