Python Interview questions - dtb
(Python version 3.9 or later version)
What would be the result of executing the following code?
|
TrueTrue
True True
2
Syntax Error
|
Explanation
In python, True is boolean (notice the uppercase T) and True evaluates to 1 (False evaluates to 0) and hence 1 multiplied by 2 is 2
|