Post

@Python_Dv Answer: B) world
True > False is valid in Python because bool is a subclass of int (True==1, False==0).
So True > False → 1 > 0 → True, and it prints "hello"? Wait — careful:
If condition is True, it prints "hello". So the correct output is A) hello
English

@Python_Dv A) hello.
bool type is a subclass of int. This means that True and False have underlying integer values:
True is equal to 1
False is equal to 0
English

@Python_Dv Python: "True > False evaluates to True, so print hello"
Everyone: "wait that's illegal"
English

@Python_Dv The correct answer is A, but the most correct answer is to lock up whoever wrote this code.
English

@Python_Dv A. Hello
In Python, True is greater than False.
Why? Because booleans are a subclass of integers:
True == 1
False == 0
English















