Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Python

Knowledge base — Python

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

Entries: 583

Python

getattr()

Reads an attribute whose name is supplied as a string.

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

globals()

Returns the dictionary implementing the current module’s global namespace.

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

hasattr()

Attempts an attribute lookup and reports whether it finishes without AttributeError.

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

hash()

Computes a hash code used by sets and dictionaries for hashable objects.

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

help()

Displays interactive documentation for a supplied object.

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

hex()

Formats an integer as a hexadecimal string with a base prefix.

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

id()

Returns an integer identifying an object during its lifetime.

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

__import__()

Invokes the import mechanism using a module name supplied as a string.

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

input: reading one line of text

input reads a line from standard input and returns a string without its final newline. It does not automatically turn typed digits into a number.

Basic · Python 3.14
Python

int: integers and data conversion

int creates an integer from a suitable number or text. Converting a floating-point value truncates its fractional part towards zero; it does not round to the nearest integer.

Basic · Python 3.14
Python

isinstance()

Tests whether an object is an instance of a type or a compatible subclass.

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

issubclass()

Tests a subclass relationship between classes.

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

iter()

Constructs an iterator, optionally calling an object without arguments until it returns a matching sentinel.

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

len: element count, not memory size

len returns the number of elements in an object that supports length. For strings it counts Unicode code points, not bytes or necessarily the characters a person sees.

Basic · Python 3.14
Python

list()

Materializes the items of an iterable into a new mutable list.

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

locals()

Returns a mapping describing local name bindings in the current scope.

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

map()

Lazily calls a function with one successive item from each input iterable.

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

max()

Selects the input item with the largest comparison key.

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

memoryview()

Exposes an existing buffer through a view without copying its data.

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

min()

Returns the input item with the smallest comparison key.

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

next()

Advances an iterator by one position and returns the item.

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

object()

Creates a fresh instance of the common base class for Python objects.

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

oct()

Formats an integer as a base-eight string with an octal prefix.

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

open()

Opens a file as a text or binary stream according to its mode.

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