Update formatting

This commit is contained in:
Isabelle Viktoria Maciohsek
2022-01-30 19:18:14 +02:00
parent c95f39e4ba
commit 2a16eb9892
6 changed files with 10 additions and 10 deletions

View File

@ -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):