abc[i+1]
пытается получить элемент с индексом 26, которого не существует в списке.abc = 'abcdefghijklmnopqrstuvwxyz'
ls = [char*count for char, count in enumerate(abc, 1)]
print(ls)
find . -type f -regextype posix-egrep -regex ".*/(.{3,5})\.([^\.]+)$"
-exec
но можно и пережитьfind . -type f | grep -P "/(.{3,5})\.([^\.]+)$"
How are lists implemented in CPython?¶
CPython’s lists are really variable-length arrays, not Lisp-style linked lists. The implementation uses a contiguous array of references to other objects, and keeps a pointer to this array and the array’s length in a list head structure.
This makes indexing a list a[i] an operation whose cost is independent of the size of the list or the value of the index.
When items are appended or inserted, the array of references is resized. Some cleverness is applied to improve the performance of appending items repeatedly; when the array must be grown, some extra space is allocated so the next few times don’t require an actual resize.