Post

@PythonPr True=1 and false =0 in python so answer will be 6 for x+y
English

@PythonPr I'll make it simple for you:
True = 1
False = 0
x = 1 + 1 * 2 =3
y = 0 + 3 = 3
x + y = 6
The answer is: 6
English

@PythonPr Ans: 6
When we start processing X as it contains numerical operators (+ and *) the value true and false are converted to the numerical equivalent of them. True becomes 1, false becomes 0. Now the calculation is simple
X = 1+ 1*2 => 1+2 => 3
Y = 0+3 => 3
X+Y = 6
English

@PythonPr 6
In Python,the boolean type is a subclass of integers.This means True and False behave like int math opration
True is treated as 1
False is treated as 0
True * 2 becomes 1 x 2=2
True + 2 becomes=1+2=3
Result: x =3
False+3 becomes=0+3=3
Result:y=3
print(x+y)
3+3=6
Final Output:6
English




















