I am currently working through a few sections of "Think Python" by Allen B. Downey and I am having trouble understanding the solution to the question in Section 16.1:
Write a boolean function called is_after that takes two Time objects, t1 and t2, and returns True if t1 follows t2 chronologically and False otherwise. Challenge: don’t use an if statement.
His solution is the following:
def is_after(t1, t2):
"""Returns True if t1 is after t2; false otherwise."""
return (t1.hour, t1.minute, t1.second) > (t2.hour, t2.minute, t2.second)
Full solution code shown here.
Questions: Is this operator comparing on multiple values at once? How this this working? Where can I read more about this?