On Tue, 8 Nov 2022 at 03:08, ICT Ezy <ict...@gmail.com> wrote:

> Please explain how to generate different output in following logical 
> operations

> >>> 0 and True
> 0
> >>> 0 or True
> True
> >>> 1 and True
> True
> >>> 1 or True
> 1

Hi,

The exact explanation of how 'and' and 'or' behave can be read here:
  https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not
The "Notes" there explain what you see.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to