+++ title = "python `or [default]`" date = 2023-10-02 [taxonomies] tags= ["shortnotes"] +++ Did you know that you can use the “or” keyword in python to set a “default” for a variable? ```py variable_name = value_or_none() or "default value!" ``` Over five years since I started using Python, and I’m only learning this now. I wish I knew about it sooner.