निम्नलिखित कोड का परिणाम क्या है ?
What is the output of the following code ?
a = 50
b = a= a*5
print(b)
A)
B)
C)
D)
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 * 5
is evaluated first, which results in50 * 5 = 250
. - This result is assigned to
a
, soa
becomes250
. - Simultaneously,
b
is 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