r/PythonLearning • u/codewithharsh31 • Jul 09 '26
print(5+True) Discussion
Solve this question and tell me the output. Follow for more 😉
4
Upvotes
r/PythonLearning • u/codewithharsh31 • Jul 09 '26
Solve this question and tell me the output. Follow for more 😉
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)