Convert Algorithm To Python Code For Snake