print((-3)** 2) का आउटपुट क्या है?
What is the output of print((-3)** 2) ?
A
-9
B
6
C
-6
D
9
Explanation
The correct answer is:
(D) 9
Explanation:
- In Python, the expression
(-3)**2means that the negative number-3is raised to the power of2. - The exponentiation operator
**has higher precedence than the negative sign, so-3is treated as(-3)and then squared. - Squaring
-3gives9because: (−3)×(−3)=9(-3) \times (-3) = 9
Output:
(D) 9
Correct Answer: D) 9