Godot Version
4.0
Question
This is probably a silly question, but in Lua there is a clever feature: if I want to give a variable x the value val1 if some condition is true, and otherwise the value val2, then I can bypass an annoying if-then clause by just being clever with booleans, viz.:
x = condition and val1 or val2
Then x will have the value val1 if and only if the boolean condition
is true; otherwise x will have the value val2.
Is something similar possible in GDScript? In other words, I want to write a single line such that the value of x
is determined by one of two possible choices.