Python Programming - Tricky Questions - Discussion
Discussion Forum : Tricky Questions - General Questions (Q.No. 39)
39.
What is the output of the following Python code?
x = 2
y = 3
result = x * y ** x
print(result)
Answer: Option
Explanation:
Exponentiation (**), performed before multiplication, results in 3 ** 2, and then multiplied by 2.
Discussion:
1 comments Page 1 of 1.
Satya Ranjan Sethy said:
1 month ago
Ans:-18
It happens due tooperator precedence
It happens due tooperator precedence
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers