jroid8@lemmy.world to Programmer Humor@lemmy.ml · 11 months agoknow the features of your languagelemmy.worldimagemessage-square25fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageknow the features of your languagelemmy.worldjroid8@lemmy.world to Programmer Humor@lemmy.ml · 11 months agomessage-square25fedilink
minus-squarestebo02@sopuli.xyzlinkfedilinkarrow-up0·11 months agoPython: return a or b i like it because it reads like a sentence so it somewhat makes sense and you can make it more comprehensive if you want to: return a if a is not None else b
minus-squareTurun@feddit.delinkfedilinkarrow-up0·edit-211 months agoThis diverges from the OP code snippets if a has the value False.
Python:
return a or b
i like it because it reads like a sentence so it somewhat makes sense
and you can make it more comprehensive if you want to:
return a if a is not None else b
This diverges from the OP code snippets if a has the value
False
.