Skip to main content

113 posts tagged with "uv"

uv, the Fast Python Package and Project Manager, Its Commands and pyproject.toml

View All Tags

How to Use or to Fall Back to a Default Value in Python

· 3 min read
Jagdish Kumawat
Founder @ Dewiride

A value from a form, a file or a setting is sometimes empty, and you want a sensible default in its place. Python's or does that in one expression: it gives you the first value, unless that value is empty, and then the second. This guide shows it with a display name, with real output from Python 3.15.2.