def cickle():
lst = []
for i in range(10001):
if i % 2 == 0:
lst.append(i)
return lst
def generator():
lst = [i for i in range(10001) if i % 2 == 0]
return lst
assert cickle() == generator() # проверяем что вывод функций одинаков
%timeit cickle()
390 µs ± 5.3 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
%timeit generator()
318 µs ± 8.28 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
Кроме того, не подскажите ли, какие диоды лучше всего подойдут?
The new Compose V2, which supports the compose command as part of the Docker CLI, is now available.
Compose V2 integrates compose functions into the Docker platform, continuing to support most of the previous docker-compose features and flags. You can run Compose V2 by replacing the hyphen (-) with a space, using docker compose, instead of docker-compose.