Friday 4 December 2015

Python: Short circuit operators


Boolean operators and, or are called short circuit operators, it Is because evaluation of expression stops, whenever the outcome determined.

Why Boolean and is called short circuit operator?
Since if the first statement in the expression evaluates to false, then python won't evaluates the entire expression. So boolean and is called short circuit and.

Why Boolean OR is called short circuit operator?
Since if the first statement evaluates to true, then Python won't evaluates the entire expression. 



Previous                                                 Next                                                 Home

No comments:

Post a Comment