python: add note on optional function params
This commit is contained in:
parent
a71a362507
commit
aa63c0b1bb
1 changed files with 11 additions and 1 deletions
|
@ -58,6 +58,16 @@ greeter('Eloise')
|
||||||
# Welcome Eloise - Live Long and Prosper
|
# 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
|
## Function with arbitrary parameter list
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
@ -75,7 +85,7 @@ Welcome Adam
|
||||||
Welcome Gryff
|
Welcome Gryff
|
||||||
Welcome Natalia
|
Welcome Natalia
|
||||||
"""
|
"""
|
||||||
```
|
````
|
||||||
|
|
||||||
## Scoping
|
## Scoping
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue