Comment on call the doctor, the CS doctor
HurgletOfficial@lemmy.basedcount.com 1 year agoYou can do
if (count := len(hand)) != 5: # do something with "count"
Btw, looks much nicer
Comment on call the doctor, the CS doctor
HurgletOfficial@lemmy.basedcount.com 1 year agoYou can do
if (count := len(hand)) != 5: # do something with "count"
Btw, looks much nicer
conditional_soup@lemm.ee 1 year ago
I’ll use ternary operators when you force them into my cold, dead hands
HurgletOfficial@lemmy.basedcount.com 1 year ago
It’s not the ternary operator, it is the walrus operator introduced in Python 3.8 if I’m correct
conditional_soup@lemm.ee 1 year ago
You are correct. I came back to say that I’ll use the walrus operator when it’s pushed into my cold, dead hands, but… I might actually use it, now that I’ve refreshed myself on it.