Ad
  • Custom User Avatar

    You have a list of 2 numbers: [0, abs(res)].
    If the (res<0) returns True then the second item is taken. That is because True is the same as 1 in Python and the item with index 1 is abs(res).
    If the (res<0) return False then the first item is taken (False = 0 in Python). So the item with index 0 is 0 in that case