Computer Applications
What will be the output of
print 3*2**2
- 81
- 18
- 36
- 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
What is the output of following code ?
print "8 >= 8"- 8 >= 8
- False
- True
- Error
What will be the output of following code ?
print(8 >= 8)- 8 >= 8
- False
- True
- Error
What will be the output of
print (3*2)**2- 81
- 18
- 36
- 12
Which of the following has the highest precedence in an expression ?
- Exponentiation (**)
- Multiplication (*)
- Division (/)
- Parenthesis (())