KnowledgeBoat Logo
|

Computer Applications

What will be the output of

print 3*2**2
  1. 81
  2. 18
  3. 36
  4. 12

Python Funda

3 Likes

Answer

12

Reason — The given expression 3*2**2 is evaluated as follows:

= 3 * 2 ** 2
= 3 * 4 (Since exponentiation (**) has higher precedence than multiplication (*))
= 12

Thus, 12 is printed as output.

Answered By

1 Like


Related Questions