Base de conhecimentoCentro de Exames
PT · PTPortuguês (Portugal)
Escolher idioma13

CKTIS / Python

Base de conhecimento — Python

Sintaxe, operadores e conceitos de programação. Encontra uma explicação, consulta um exemplo e continua a aprender.

Entradas: 583

Python

str.count

Conta ocorrências não sobrepostas de uma subcadeia no intervalo escolhido.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.encode

Codifica o texto na codificação escolhida e devolve bytes.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.endswith

Verifica se o texto termina num sufixo exato; um tuplo permite várias alternativas.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.find

Devolve o menor índice da subcadeia dentro dos limites da pesquisa.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.format

Insere argumentos posicionais ou nomeados nos campos do modelo e aplica as especificações de formato.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.format_map

Lê os campos nomeados diretamente do mapeamento fornecido.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.index

Devolve o primeiro índice da subcadeia dentro dos limites, contado a partir do início do texto original.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.isalnum

Devolve um booleano para texto não vazio constituído apenas por letras ou carateres numéricos Unicode.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.isalpha

Exige texto não vazio constituído apenas por letras Unicode.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.isdigit

Verifica se um texto não vazio contém apenas algarismos Unicode. ² é um algarismo mas não decimal: isdigit dá True e isdecimal dá False.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.isspace

Devolve True apenas para texto não vazio constituído por espaços em branco.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.join

Une as cadeias de um iterável colocando o separador que recebe a chamada entre as posições.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.lower

Devolve o texto convertido em minúsculas Unicode.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.lstrip

Remove à esquerda espaços em branco ou, com chars, qualquer caráter desse conjunto.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.removeprefix

Remove uma única ocorrência do prefixo exato no início.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.removesuffix

Remove uma única vez o sufixo exato.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.replace

Substitui as ocorrências literais não sobrepostas de old por new.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.rfind

Devolve o maior índice inicial de uma subcadeia entre start e end.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.rsplit

Divide a partir da direita. Por predefinição sep=None usa grupos de espaços em branco e maxsplit=−1 não limita os cortes.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.rstrip

Remove à direita espaços em branco ou carateres do conjunto opcional chars.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.split

Divide o texto numa lista de campos.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.splitlines

Divide o texto em linhas. CRLF constitui um só limite e não surge uma linha vazia entre one e two.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.startswith

Verifica o início exato do texto ou do segmento com start e end opcionais, excluindo end.

Intermédio · Python 3.14; repository image, production runtime not attested
Python

str.strip

Remove nas extremidades espaços em branco ou os carateres individuais do parâmetro opcional chars.

Intermédio · Python 3.14; repository image, production runtime not attested