In other languages you can do
var foo = a[0] | b
which sets foo to a[0] unless it evaluates as false (undefined, null, false etc), then it sets it to b.
It looks like in godot you have to do
var foo = a[0] if a[0] else b
which is an unfortunate repeat of a[0] meaning you either have to define a[0] to a new variable first, or look it up twice...