python: add note on optional function params

This commit is contained in:
thomasabishop 2023-06-12 07:23:40 +01:00
parent a71a362507
commit aa63c0b1bb

View file

@ -58,6 +58,16 @@ greeter('Eloise')
# Welcome Eloise - Live Long and Prosper
```
## Optional parameters
````py
def func_with_optional(non_optional, optional_param=None):
if optional_param is not None:
# Do something with specific value
else:
# Run standard process
## Function with arbitrary parameter list
```python
@ -75,7 +85,7 @@ Welcome Adam
Welcome Gryff
Welcome Natalia
"""
```
````
## Scoping