Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 5788

Python

Comments and documentation

A # outside a string literal begins a comment that continues to the end of the physical line.

Basic · Python 3.14; repository image, production runtime not attested
Python

Comprehensions

Build a list, set or dictionary by nesting iteration clauses in written order and applying filters before the output expression.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Conditional control flow

An if statement tests its conditions in order and executes the first truthy branch.

Basic · Python 3.14; repository image, production runtime not attested
Python

Context managers

A with statement binds the result of `__enter__` to its as target and invokes `__exit__` when leaving the block.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Data processing pipelines

Connect a source, lazy parsing and selection stages, and a terminal operation that drives consumption.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Decorators

Decorator expressions are evaluated at definition time from top to bottom and applied from bottom to top.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Error handling

An exception interrupts normal evaluation and searches outward for the first matching except clause.

Basic · Python 3.14; repository image, production runtime not attested
Python

Expressions and operators

Operator precedence determines expression grouping, and parentheses can override it.

Basic · Python 3.14; repository image, production runtime not attested
Python

Filtering and transformations

Filtering keeps original values whose predicate is true, while mapping emits the transformed value for every input it receives.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Finite-state machines

The current state and event form a key that selects the next state in a finite transition table.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Functions and parameters

For an ordinary undecorated function, def binds its name to the function and a call executes its body. A generator function call creates a generator, and a decorator can bind the name to another object.

Basic · Python 3.14; repository image, production runtime not attested
Python

Input, output and serialization

Separate the stream’s bytes, their character encoding and the format parsed from the resulting text.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Iterators and generators

An iterable can supply an iterator, whose next operation advances state and signals exhaustion with StopIteration.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Linear search

Inspect values in encounter order until the first equality match.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Event logging

A logger decides whether to accept an event at its severity and a handler chooses the output destination and threshold.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Loops and iteration

A for loop consumes an iterator, while a while loop retests its condition before every iteration.

Basic · Python 3.14; repository image, production runtime not attested
Python

References and copies

Assignment binds another name to an existing object without copying it.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Modules and namespaces

A module owns a namespace, and an import binds a name in the importing code.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Numeric types and precision

Select an integer, binary float, decimal or rational representation to match the calculation.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Object model and composition

An object can hold another object in an instance attribute and delegate work to it.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Performance and complexity

Count the work that grows with input size and distinguish it from machine-dependent elapsed time.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Program entry point

A module run as a script or with python -m receives the name `__main__` for its top-level code.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Records and aggregates

Model one record with named fields and calculate an aggregate across many records.

Intermediate · Python 3.14; repository image, production runtime not attested
Python

Recursion

A recursive function solves smaller subproblems and terminates each branch at a base case.

Intermediate · Python 3.14; repository image, production runtime not attested