What is the output of print(True + True) in Python?
print(True + True)
Correct answer
D. 2
5 views
D. 2
5 views
bool is a subclass of int, so True + True equals 2.
Asked in: Python Interview Data Types
https://docs.python.org/3/library/stdtypes.htmlNot sure why the answer is D? Ask here and get an explanation.