Base di conoscenzaCentro esami
ITItaliano
Scegli la lingua13

CKTIS / Python

Base di conoscenza — Python

Sintassi, operatori e concetti di programmazione. Trova una spiegazione, consulta un esempio e torna a imparare.

Voci: 583

Python

str.count

Conta le occorrenze non sovrapposte di una sottostringa nell’intervallo scelto.

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

str.encode

Codifica il testo con la codifica scelta e restituisce bytes.

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

str.endswith

Verifica se il testo termina con un suffisso esatto; una tupla ammette più alternative.

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

str.find

Restituisce l’indice più basso della sottostringa entro i limiti di ricerca.

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

str.format

Inserisce argomenti posizionali o con nome nei campi del modello e applica le specifiche di formato.

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

str.format_map

Legge i campi con nome direttamente dalla mappatura fornita.

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

str.index

Restituisce il primo indice della sottostringa entro i limiti, contato dall’inizio del testo originale.

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

str.isalnum

Restituisce un booleano per un testo non vuoto composto soltanto da lettere o caratteri numerici Unicode.

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

str.isalpha

Richiede testo non vuoto formato soltanto da lettere Unicode.

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

str.isdigit

Verifica che il testo non vuoto contenga soltanto cifre Unicode. ² è una cifra ma non decimale: isdigit dà True e isdecimal False.

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

str.isspace

Restituisce True solo per un testo non vuoto di spazi bianchi.

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

str.join

Unisce le stringhe di un iterabile inserendo il separatore ricevente fra le posizioni.

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

str.lower

Restituisce il testo convertito in minuscolo Unicode.

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

str.lstrip

Rimuove a sinistra gli spazi bianchi o, con chars, ogni carattere dell’insieme.

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

str.removeprefix

Rimuove una sola occorrenza del prefisso esatto all’inizio.

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

str.removesuffix

Rimuove una volta il suffisso esatto.

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

str.replace

Sostituisce le occorrenze letterali non sovrapposte di old con new.

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

str.rfind

Restituisce il massimo indice iniziale di una sottostringa tra start ed end.

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

str.rsplit

Divide da destra. Per default sep=None usa gruppi di spazi bianchi e maxsplit=−1 non limita i tagli.

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

str.rstrip

Rimuove da destra gli spazi bianchi o i caratteri dell’insieme facoltativo chars.

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

str.split

Divide il testo in una lista di campi.

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

str.splitlines

Divide il testo in righe. CRLF forma un solo confine e non compare una riga vuota fra one e two.

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

str.startswith

Verifica l’inizio esatto del testo o dell’intervallo con start ed end facoltativi, escluso end.

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

str.strip

Elimina da entrambe le estremità gli spazi bianchi o i singoli caratteri del parametro facoltativo chars.

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