For instance, in C# (starting with v6) I can say:
mass = (vehicle?.Mass / 10) ?? 150;
to set mass to a tenth of the vehicle's mass if there is a vehicle, but 150 if the vehicle is null (or has a null mass, if the Mass property is of a nullable type).
Is there an equivalent construction in Python (specifically IronPython) that I can use in scripts for my C# app?
This would be particularly useful for displaying defaults for values that can be modified by other values - for instance, I might have an armor component defined in script for my starship that is always consumes 10% of the space available on the ship it's installed on, and its other attributes scale as well, but I want to display defaults for the armor's size, hitpoints, cost, etc. so you can compare it with other ship components. Otherwise I might have to write a convoluted expression that does a null check or two, like I had to in C# before v6.
if/else
statements. – Priceless