Why the output of print(True + False) is 1? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
+ 7

# Why the output of print(True + False) is 1?

19th Jul 2020, 6:29 AM
Nalayak_
16 Answers
+ 6
Here ,in python true means 1 or false means 0 so when we add both value will be 1
19th Jul 2020, 6:33 AM
Sâñtôsh
19th Jul 2020, 6:43 AM
Alexander Koval🇧🇾
+ 4
True refers to =1 false refers to=0 so according to your question(true+false)=(1+0)=1
19th Jul 2020, 10:07 AM
Sunil Kumar Sahu
+ 3
Never cease of exploration! Sololearn sandbox will give you the answer.
19th Jul 2020, 6:50 AM
Alexander Koval🇧🇾
+ 3
Their common meaning 1 = True, white, On 0 = False, black, off In this case 1 + 0 = 1
19th Jul 2020, 11:20 AM
Ahmad Sha. Habibi
+ 2
19th Jul 2020, 6:47 AM
Nalayak_
+ 2
Yes that's very true sis cause Boolean can only hold true or false which is 1 and 0 according to my understanding 😁hope it helps correct if I am wrong that's what your hear for so remove the dislike 😁
19th Jul 2020, 6:51 PM
Pjc
+ 1
Is there any print(True - False) exist?
19th Jul 2020, 6:36 AM
Nalayak_
+ 1
Same discussion topic yesterday (not as much in detail as this one) https://www.sololearn.com/Discuss/2399301/?ref=app
19th Jul 2020, 8:06 AM
Ipang
+ 1
In programming languages value of True is considered as 1. whereas false is zero.therefore In Boolean algebra True + False=1+0=1.
19th Jul 2020, 4:38 PM
Celestine Joy
+ 1
Well it's 1 because False is 0 as an integer and True is 1 as an integer. So 1+0=1
20th Jul 2020, 6:50 AM
SB5K
+ 1
Print(int(True))==>1 Print(int(False))==>0 If you treat True and False for int operations python converts them to integer form
20th Jul 2020, 4:57 PM
Dx bros
0
It doesn't exist, sorry bro it exists. that's mentioned in Alexander Koval🇧🇾
19th Jul 2020, 6:39 AM
Sâñtôsh
19th Jul 2020, 6:45 AM
Nalayak_
0
What to learn?? Which one is easy?? Java or Javascript
20th Jul 2020, 4:17 AM
Samarth Gupta
0
True value is 1 and false value is 0 .1+0 =1
20th Jul 2020, 11:48 AM
Solomon Simeon
Hot today
Bash
0 Votes
Please help
0 Votes
Link
6 Votes
Ruby
2 Votes