[issue42456] Logical Error

2020-12-11 Thread Éric Araujo
Change by Éric Araujo : -- hgrepos: -394 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42456] Logical Error

2020-12-08 Thread Tim Peters
Tim Peters added the comment: Please ask for help on StackOverflow or the general Python mailing list. Your understanding of the operations is incorrect. "&" is NOT a logical operator ("and" is). It's a bitwise operator on integers. >>> 10 & 10 10 >>> bin(10) '0b1010' The last bit is 0, so

[issue42456] Logical Error

2020-12-08 Thread Nishant Gautam
Nishant Gautam added the comment: a = 10 b = 10 if (a >= b) & (a & b) & (a == b): print("Yes") else: print("No") Output: No This is the bug because all then condition in if is true but it print No, This is the vulnerability of this code. -- resolution: not a

[issue42456] Logical Error

2020-11-24 Thread Tim Peters
Tim Peters added the comment: There's no bug here. "&" is the bitwise Boolean logical-and operator on integers. For example, >>> 1 & 2 0 >>> 1 & 3 1 It binds more tightly than the "==" equality-testing operator. To get the result you want, you would need to add more parentheses to override

[issue42456] Logical Error

2020-11-24 Thread Nishant Gautam
New submission from Nishant Gautam : The python programming give wrong output. If any algorithm develop in python then, may be that will be affected by this. -- files: 0_PROOF.png hgrepos: 394 messages: 381787 nosy: Kshitish priority: normal severity: normal status: open title: