निम्नलिखित कोड का परिणाम क्या है ?
What is the output of the following code ?
a = 50
b = a= a*5
print(b) A
250
B
10
C
50
D
Syntax Error
Explanation
Let's break down the code:
a = 50
b = a = a * 5
print(b)
- Initially,
a = 50. - Then
b = a = a * 5:- The expression
a * 5is evaluated first, which results in50 * 5 = 250. - This result is assigned to
a, soabecomes250. - Simultaneously,
bis also assigned the value ofa, which is now250.
- The expression
- Finally,
print(b)outputs the value ofb, which is250.
So, the output of the code is:
Answer: (A) 250
Correct Answer: D) Syntax Error