How To Push Function Into Array Methods Python