You are viewing a single comment's thread. Return to all comments →
similarly, you could:
apples = map(lambda x: 1 if s <= a+x <= t else 0, apples) oranges = map(lambda x: 1 if s <= b+x <= t else 0, oranges) print(sum(apples), sum(oranges))
they're both pretty pythonic. but list comprehensions are bae
Seems like cookies are disabled on this browser, please enable them to open this website
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
similarly, you could:
they're both pretty pythonic. but list comprehensions are bae