Python Lambda If Function With Nested