Defining Functions Inside Functions Python Code For Snake