In PHP, you would do something like:
$answer = ($x != null) ? true : false
instead of doing:
if($x != null) {
$answer = true;
} else {
$answer = false;
}
Is there anyway to do this in python? I've tried to google and to search in here but I couldn't find anything, plus google doesn't take symbols into searching. You might say, why didn't you google search it by name? Well I do not know what that type of line code is called.