DEV Community

DDSRY
DDSRY

Posted on • Updated on

Why does "test" and "test" return "test" or 1 and 1 return 1 instead of True in Python?

Why does "test" and "test" return "test" or 1 and 1 return 1 instead of True in Python Programming Language by DDSRY?

  • Python and many language llike it return one of the operands to their boolean
    expressions rather than just True or False.

  • This means that if you did False and 1, then you get the first operand False,
    but if you do True and 1, then you get the second(1).

Top comments (0)