Why is a type when used as a function given a boolean true return a number?

It’s generally not good form to refer people to other unresolved questions in order to answer your question. Don’t make people do work in order to understand what you’re asking. See also: Please read: make it easier to help you

It’s pretty common in programming languages for booleans true and false to be represented by 1 and 0 respectively. In python, they are literally the same (1 == True). In Julia, they’re not the same thing, but you can convert a Bool into a number as you’ve shown. To reiterate:

4 Likes