DEV Community

Discussion on: Data Types in Python

Collapse
 
michaelcurrin profile image
Michael Currin • Edited

Yes, indeed True and False are just aliases for 1 and 0.

Python is implemented in C language which actually has no boolean type so 1 and 0 are used instead.

I've never seen anyone do True + True though, lol.

Collapse
 
princeibs profile image
Suleiman Ibrahim

Yeah, true. You might not see someone use True+ True in their codes because of it's less practical use. But it is necessary for a beginner to know how these things work under the hood.
Well, when I was learning Python, I didn't know that True + True will evaluate to 2. So I think including it in an example will go a long way to help others who want to learn.

Anyways, thanks for your reviews. There are absolutely on point 🚀🚀🚀