Section: Functions

Default parameter

python
python
def connect(host: str, port: int = 5432) -> tuple[str, int]:
    return host, port

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Functions
Define a function
Define a function
OpenIn sheetpythonsame section
Keyword-only args
Keyword-only args
OpenIn sheetpythonsame section
Arbitrary positional args
Arbitrary positional args
OpenIn sheetpythonsame section
Arbitrary keyword args
Arbitrary keyword args
OpenIn sheetpythonsame section
Lambda as key
Lambda as key
OpenIn sheetpythonsame section
Unpack args into a call
Unpack args into a call
OpenIn sheetpythonsame section