Esercitazione Python

Python HOME Introduzione di Python Python per iniziare Sintassi Python Commenti Python Variabili Python Tipi di dati Python Numeri Python Fusione in pitone Stringhe Python Python booleani Operatori Python Elenchi Python Tuple di Python Insiemi Python Dizionari Python Python Se... Altro Python While Loops Python per loop Funzioni Python Python Lambda Matrici Python Classi/oggetti Python Ereditarietà Python Iteratori Python Ambito Python Moduli Python Date Python Python matematica Python JSON Python RegEx PIP Python Python Prova... Tranne Input utente Python Formattazione di stringhe Python

Gestione dei file

Gestione dei file Python File di lettura Python Python Scrivi/Crea file Python Elimina file

Moduli Python

Tutorial NumPy Guida dettagliata di Panda Tutorial Scipy

Python Matplotlib

Introduzione a Matplotlib Matplotlib Inizia Plottaggio Matplotlib Tracciatura Matplotlib Marcatori Matplotlib Linea Matplotlib Etichette Matplotlib Griglia Matplotlib Sottotrame Matplotlib Dispersione Matplotlib Barre Matplotlib Istogrammi Matplotlib Grafici a torta Matplotlib

Apprendimento automatico

Iniziare Modalità mediana media Deviazione standard percentile Distribuzione dei dati Distribuzione normale dei dati Trama a dispersione Regressione lineare Regressione polinomiale Regressione multipla Scala Treno/prova Albero decisionale

Python MySQL

MySQL per iniziare MySQL crea database MySQL Crea tabella Inserimento MySQL MySQL Seleziona MySQL dove MySQL Ordina per Elimina MySQL MySQL Drop Table Aggiornamento MySQL Limite MySQL Unisciti a MySQL

Python MongoDB

MongoDB Inizia MongoDB Crea database MongoDB Crea raccolta Inserisci MongoDB MongoDB Trova Interrogazione MongoDB Ordinamento MongoDB Elimina MongoDB Collezione Drop MongoDB Aggiornamento MongoDB Limite MongoDB

Riferimento Python

Panoramica di Python Funzioni integrate in Python Metodi di stringa Python Metodi dell'elenco Python Metodi del dizionario Python Metodi della tupla Python Metodi di impostazione Python Metodi di file Python Parole chiave Python Eccezioni Python Glossario Python

Riferimento del modulo

Modulo casuale Modulo Richieste Modulo Statistiche Modulo di matematica Modulo cMath

Python come fare per

Rimuovi i duplicati dell'elenco Invertire una stringa Aggiungi due numeri

Esempi Python

Esempi Python Compilatore Python Esercizi di Python Python Quiz Certificato Python

Python - Metodi di stringa


Metodi di stringa

Python ha una serie di metodi integrati che puoi usare sulle stringhe.

Nota: tutti i metodi stringa restituiscono nuovi valori. Non cambiano la stringa originale.

Method Description
capitalize()Converts the first character to upper case
casefold()Converts string into lower case
center()Returns a centered string
count()Returns the number of times a specified value occurs in a string
encode()Returns an encoded version of the string
endswith()Returns true if the string ends with the specified value
expandtabs()Sets the tab size of the string
find()Searches the string for a specified value and returns the position of where it was found
format()Formats specified values in a string
format_map()Formats specified values in a string
index()Searches the string for a specified value and returns the position of where it was found
isalnum()Returns True if all characters in the string are alphanumeric
isalpha()Returns True if all characters in the string are in the alphabet
isdecimal()Returns True if all characters in the string are decimals
isdigit()Returns True if all characters in the string are digits
isidentifier()Returns True if the string is an identifier
islower()Returns True if all characters in the string are lower case
isnumeric()Returns True if all characters in the string are numeric
isprintable()Returns True if all characters in the string are printable
isspace()Returns True if all characters in the string are whitespaces
istitle() Returns True if the string follows the rules of a title
isupper()Returns True if all characters in the string are upper case
join()Joins the elements of an iterable to the end of the string
ljust()Returns a left justified version of the string
lower()Converts a string into lower case
lstrip()Returns a left trim version of the string
maketrans()Returns a translation table to be used in translations
partition()Returns a tuple where the string is parted into three parts
replace()Returns a string where a specified value is replaced with a specified value
rfind()Searches the string for a specified value and returns the last position of where it was found
rindex()Searches the string for a specified value and returns the last position of where it was found
rjust()Returns a right justified version of the string
rpartition()Returns a tuple where the string is parted into three parts
rsplit()Splits the string at the specified separator, and returns a list
rstrip()Returns a right trim version of the string
split()Splits the string at the specified separator, and returns a list
splitlines()Splits the string at line breaks and returns a list
startswith()Returns true if the string starts with the specified value
strip()Returns a trimmed version of the string
swapcase()Swaps cases, lower case becomes upper case and vice versa
title()Converts the first character of each word to upper case
translate()Returns a translated string
upper()Converts a string into upper case
zfill()Fills the string with a specified number of 0 values at the beginning