Question: need a through d Q2.2.2 The operators listed in Table 2.1 are all binary operators: they take two operands (numbers) and return a single value.
Q2.2.2 The operators listed in Table 2.1 are all binary operators: they take two operands (numbers) and return a single value. The symbol - is also used as a unary operator, which returns the negative value of the single operand on which it acts. For example, >>> b-a >>> b Note that the expression b = -a (which sets the variable b to the negative value of a) is different from the expression b = a (which subtracts a from b and stores the result in b). The unary - operator has a higher precedence than*/ and % but a lower precedence than exponentiation (**), so that, for example -2 ** 4 is -16 (i.e. -(24), not (-2)*). Predict the result of the following expressions and check them using the Python shell. (b) -2 ** 2 2 ** -2 -2 ** -2 2 ** 2 ** 3 (d)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
