4 ms·
I think the problem here is that nested comprehensions and filter comprehensions are almost always too complex. If you are doing something that requires that, y
by iamsohungry 11y ago
I think the problem here is that nested comprehensions and filter comprehensions are almost always too complex. If you are doing something that requires that, you should break it up and give the pieces names:
odd_numbers = range(1, limit, 2)
doubled_odd_numbers = [n * 2 for n in odd_numbers]