• + 26 comments

    You can also use the fact that True == 1 and False == 0

    print(sum(s <= a + d <= t for d in apples))
    print(sum(s <= b + d <= t for d in oranges))