Update formatting
This commit is contained in:
@ -5,9 +5,9 @@ firstSeen: 2020-01-02T20:25:45+02:00
|
||||
lastUpdated: 2020-11-09T23:56:11+02:00
|
||||
---
|
||||
|
||||
Tests a value, `x`, against a testing function, conditionally applying a function.
|
||||
Tests a value, `x`, against a testing function, conditionally applying a function.
|
||||
|
||||
- Check if the value of `predicate(x)` is `True` and if so return `when_true(x)`, otherwise return `x`.
|
||||
- Check if the value of `predicate()` is `True` for `x` and if so call `when_true()`, otherwise return `x`.
|
||||
|
||||
```py
|
||||
def when(predicate, when_true):
|
||||
|
||||
Reference in New Issue
Block a user