I saw this question but it uses the ?? operator as a null check, I want to use it as a bool true/false test.
I have this code in Python:
if self.trait == self.spouse.trait: trait = self.trait else: trait = defualtTrait
In C# I could write this as:
trait = this.trait == this.spouse.trait ? this.trait : defualtTrait;
Is there a similar way to do this in Python?
External links referenced by this document: