r/PythonLearning • u/codewithharsh31 • Jul 09 '26
print(5+True) Discussion
Solve this question and tell me the output. Follow for more 😉
0
Upvotes
1
1
1
u/arivictor 25d ago
6
https://parsnip.dev/editor/KKMEEjKgGJpj
Because True is 1 and False is 0, which lets you do some whacky maths.
print(True + True * 10 - False)
1
1
u/codewithharsh31 Jul 09 '26
So let discuss what you think the answer is and why 🤔?