Conditional Operator (? 🙂
The conditional operator first evaluates an expression for a true or false value and then executes one of the two given statements depending upon the result of the evaluation.
|Sr.No||Operator and Description|
|1||? : (Conditional )
If Condition is true? Then value X : Otherwise value Y
((a > b) ? 100 : 200) => 200 ((a < b) ? 100 : 200) => 100 Set the variables to different values and different operators and then try...
- 53Operators are the constructs which can manipulate the value of operands. Consider the expression 4 + 5 = 9. Here, 4 and 5 are called operands and + is called operator. Types of Operator Python language supports the following types of operators. Python Arithmetic Operators Assume variable a holds 10…