Baza wiedzyCentrum egzaminacyjne
PLPolski
Wybierz język13

CKTIS / Python

Baza wiedzy — Python

Składnia, operatory i pojęcia programowania. Znajdź wyjaśnienie, sprawdź przykład i wróć do nauki.

Liczba haseł: 583

Python

str.title

Rozpoczyna grupę liter od formy tytułowej, a kolejne litery zmienia na małe.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

str.upper

Zwraca napis zapisany wielkimi literami zgodnie z Unicode.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

str.zfill

Dopełnia tekst zerami ASCII do minimalnej szerokości width.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

sys.stdout — standardowy strumień wyjściowy

sys.stdout to tekstowy strumień standardowego wyjścia Pythona, używany domyślnie przez print(). Pozwala bezpośrednio zapisywać tekst i opróżniać bufor; nie musi wskazywać terminala.

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

timeit.repeat

repeat zwraca listę czasów w kolejności pomiarów.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

timeit.timeit

timeit mierzy łączny czas number wykonań instrukcji lub funkcji bez argumentów.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

timeit.Timer

Timer zapisuje instrukcję i przygotowanie jako tekst lub funkcje bez argumentów.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

type.__name__

Atrybut klasy zwraca prostą nazwę typu, bez modułu ani otaczających klas.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.Annotated

Do typu bazowego dołącza metadane w podanej kolejności.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.Any

Oznacza wartość podlegającą dynamicznemu sprawdzaniu typu.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.Callable

Opisuje wywoływalny obiekt przez typy argumentów i wyniku.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.cast

Wskazuje analizatorowi zakładany typ wyrażenia.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.ClassVar

Oznacza atrybut klasy, którego analizator nie pozwala przypisywać przez instancję.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.Dict — starszy zapis adnotacji słownika

typing.Dict opisuje typy kluczy i wartości słownika. Od Python 3.9 jest przestarzałym aliasem dict; w nowym kodzie używaj dict[K, V]. Adnotacja nie sprawdza danych podczas wykonania.

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

typing.Final

Deklaruje nazwę, której analizator nie pozwala ponownie przypisać ani przesłonić w podklasie.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.Generic

Baza Generic[T] deklaruje klasę z wcześniej utworzonym parametrem typu T.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.List — starsza adnotacja typu listy

typing.List[T] opisuje listę elementów typu T. W Python 3.14 pozostaje dostępne, ale w nowym kodzie należy preferować list[T].

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

typing.Literal

Ogranicza typ statyczny do określonych wartości literalnych.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.NamedTuple

Tworzy niemutowalną podklasę tuple z nazwanymi, adnotowanymi polami dostępnymi także przez indeks i rozpakowanie.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.Never

Typ pusty nie ma żadnych możliwych wartości.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.NewType

Tworzy odrębny statyczny podtyp, np. dla identyfikatora opartego na int.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.NotRequired

Pozwala pominąć konkretny klucz TypedDict, nawet jeśli pozostałe są domyślnie wymagane.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.Optional

Dopuszcza wartość typu T albo None, tak jak unia tych dwóch typów.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested
Python

typing.overload

Deklaruje alternatywne zależności między typami argumentów a wynikiem dla analizatora.

Średniozaawansowany · Python 3.14; repository image, production runtime not attested