How To Push Function Into Array Methods In Python