part iitalking the talk understanding python' one ternary operator ternary operator requires three elements python supports just one such operatorand you use it to determine the truth value of an expression this operator takes the following formtruevalue if expression else falsevalue when the expression is truethe operator outputs truevalue when the expression is falseit outputs falsevalue as an exampleif you type "helloif true else "goodbyethe operator outputs response of 'hellohoweverif you type "helloif false else "goodbyethe operator outputs response of 'goodbyethis is handy operator for times when you need to make quick decision and don' want to write lot of code to do it one of the advantages of using python is that it normally has more than one way to do things python has an alternative form of this ternary operator -an even shorter shortcut it takes the following form(falsevaluetruevalue[expressionas beforewhen expression is truethe oper ator outputs truevalueotherwiseit outputs falsevalue notice that the truevalue and falsevalue elements are reversed in this case an example of this version is ("hello""goodbye")[truein this casethe output of the operator is 'goodbyebecause that' the value in the truevalue position of the two formsthe first is little clearerwhile the second is shorter defining the operators an operator accepts one or more inputs in the form of variables or expressionsperforms task (such as comparison or addition)and then provides an output consistent with that task operators are classified partially by their effect and partially by the number of elements they require for examplea unary operator works with single variable or expressiona binary operator requires two the elements provided as input to an operator are called operands the operand on the left side of the operator is called the left operandwhile the operand on the right side of the operator is called the right operand the following list shows the categories of operators that you use within pythonunary arithmetic relational