Update README.md

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2023-12-13 15:52:36 +01:00 committed by GitHub
parent 36000ced3e
commit d64bb2cd36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -325,7 +325,46 @@ my_tuple_c = [3, 4, 5]
print(f(2, *my_tuple_c)) # -> 120 print(f(2, *my_tuple_c)) # -> 120
``` ```
## Documentation strings ## [Documentation strings](https://peps.python.org/pep-0257/)
```python
def my_function():
"""This is a universal function.
It does nothing."""
pass
help(my_function)
```
Output:
```python
Help on function my_function in module __main__:
my_function()
This is a universal function.
It does nothing.
```
One liner:
```python
def my_function():
"""This is a universal function."""
pass
```
Novelization:
```python
def my_function():
"""This is a universal function.
a
b
d
end"""
pass
```
## [Lambda expressions / anonymous functions](https://docs.python.org/3/reference/expressions.html#lambda) ## [Lambda expressions / anonymous functions](https://docs.python.org/3/reference/expressions.html#lambda)