Python · Generators & Iterators
What does this print? from itertools import dropwhile, takewhile data = [1, 2, 3, 1, 2] pred = lambda x: x < 3 print(list(takewhile(pred, data))) print(list(dropwhile(pred, data)))
Answer locked. Get the free KnowCard app to reveal it — plus spaced-repetition review so it actually sticks.
