Hacker News new | ask | show | jobs
by c6401 732 days ago
Additionally to the provided answers:

if sanity_check(): variable = something()

variable = sanity_check() and something

(but the standard python two line way is more readable unless it's a throwaway single use code, then whatever)