Quiz: Which syntax creates a list of squared numbers from 0 to 4 in a single line?
[x**2 for x in range(5)] is a list comprehension producing [0, 1, 4, 9, 16] .
Find tutorials, system documentation, dynamic pages, and interactive quizzes in one place.
[x**2 for x in range(5)] is a list comprehension producing [0, 1, 4, 9, 16] .
Because tuples are immutable (their contents cannot change), they produce a fixed hash value and can be used as dictionary keys.
ss -tuln displays TCP (-t), UDP (-u), listening sockets (-l), without resolving names (-n).
ldd (list dynamic dependencies) prints the shared objects (.so files) required by each program or library argument.
YAML sequences (lists) use a hyphen followed by at least one space ( - item ) .
Default arguments in Python are evaluated once when the function definition is executed , meaning mutations persist across subsequent function invocations.
Generators evaluate lazily on demand using an iterator protocol, maintaining a minimal memory footprint regardless of dataset size.
NumPy ndarray stores elements of uniform dtype in contiguous memory buffers, enabling cache locality and vectorized C/Fortran SIMD execution.