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

·

1 min read

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

  • Python and many languages like 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).

    Read more...

Follow DDSRY on Twitter To Learn Python Programming Language: