Python Apply Function With Multiple Variables Definition