I'm trying to use a ? b : c
in Python. Trying to do something like
value = isChecked() ? 3 : 4
fails. Can I use some sort of notation like this in Python, like I can do in C++ and many other languages? If not, are there any alternatives?
I'm trying to use a ? b : c
in Python. Trying to do something like
value = isChecked() ? 3 : 4
fails. Can I use some sort of notation like this in Python, like I can do in C++ and many other languages? If not, are there any alternatives?