String Methods

 0    48 карточки    sir
скачать mp3 Печать играть Проверьте себя
 
Вопрос Ответ
Capitalizes first letter of string
начать обучение
capitalize()
Returns a string padded with fillchar with the original string CENTERED to a total of width columns.
начать обучение
center(width, fillchar)
Counts how many times str occurs in string or in a substring of string if starting index beg and ending index end are given.
начать обучение
count(str, beg = 0, end = len(string))
Decodes the string using the codec registered for encoding. encoding defaults to the default string encoding.
начать обучение
decode(encoding = 'UTF-8', errors = 'strict')
Returns encoded string version of string
on error, default is to raise a ValueError unless errors is given with 'ignore' or 'replace'.
начать обучение
encode(encoding = 'UTF-8', errors = 'strict')
Expands tabs in string to multiple spaces
defaults to 8 spaces per tab if tabsize not provided.
начать обучение
expandtabs(tabsize = 8)
Determine if str occurs in string or in a substring of string if starting index beg and ending index end are given returns index if found and -1 otherwise.
начать обучение
find(str, beg = 0 end = len(string))
Same as find(), but raises an exception if str not found.
начать обучение
index(str, beg = 0, end = len(string))
Returns true if string has at least 1 character and all characters are alphanumeric and false otherwise.
начать обучение
isalnum()
Returns true if string has at least 1 character and all characters are alphabetic and false otherwise.
начать обучение
isalpha()
Returns true if string contains only digits and false otherwise.
начать обучение
isdigit()
Returns true if string has at least 1 cased character and all cased characters are in lowercase and false otherwise.
начать обучение
islower()
Returns true if a unicode string contains only numeric characters and false otherwise.
начать обучение
isnumeric()
Returns true if string contains only whitespace characters and false otherwise.
начать обучение
isspace()
Returns true if string is properly "titlecased" and false otherwise.
начать обучение
istitle()
Returns true if string has at least one cased character and all cased characters are in uppercase and false otherwise.
начать обучение
isupper()
Merges (concatenates) the string representations of elements in sequence seq into a string, with separator string.
начать обучение
join(seq)
Returns the length of the string
начать обучение
len(string)
Returns a space-padded string with the original string left-justified to a total of width columns.
начать обучение
ljust(width[, fillchar])
Converts all uppercase letters in string to lowercase.
начать обучение
lower()
Removes all leading whitespace in string.
начать обучение
lstrip()
Returns a translation table to be used in translate function.
начать обучение
maketrans()
Returns the max alphabetical character from the string str.
начать обучение
max(str)
Returns the min alphabetical character from the string str.
начать обучение
min(str)
Replaces all occurrences of old in string with new or at most max occurrences if max given.
начать обучение
replace(old, new [, max])
Same as find(), but search backwards in string.
начать обучение
rfind(str, beg = 0, end = len(string))
Same as index(), but search backwards in string.
начать обучение
rindex(str, beg = 0, end = len(string))
Returns a space-padded string with the original string right-justified to a total of width columns.
начать обучение
rjust(width,[, fillchar])
Removes all trailing whitespace of string.
начать обучение
rstrip()
Splits string according to delimiter str (space if not provided) and returns list of substrings
начать обучение
split(str="", num=string. count(str))
split into at most num substrings if given.
Splits string at all (or num) NEWLINEs and returns a list of each line with NEWLINEs removed.
начать обучение
splitlines(num=string. count('\n'))
Determines if string or a substring of string (if starting index beg and ending index end are given) starts with substring str
returns true if so and false otherwise.
начать обучение
startswith(str, beg=0, end=len(string))
Performs both lstrip() and rstrip() on string
начать обучение
strip([chars])
Inverts case for all letters in string.
начать обучение
swapcase()
Returns "titlecased" version of string, that is, all words begin with uppercase and the rest are lowercase.
начать обучение
title()
Translates string according to translation table str(256 chars), removing those in the del string.
начать обучение
translate(table, deletechars="")
Converts lowercase letters in string to uppercase.
начать обучение
upper()
Returns original string leftpadded with zeros to a total of width characters
intended for numbers, it retains any sign given (less one zero).
начать обучение
zfill (width)
Returns true if a unicode string contains only decimal characters and false otherwise.
начать обучение
isdecimal()
Converts string into lower case
начать обучение
casefold()
Returns True if the string is an identifier
начать обучение
isidentifier()
Returns a tuple where the string is parted into three parts
начать обучение
partition()
Splits the string at the specified separator, and returns a list
начать обучение
rsplit()
Splits the string at the specified separator, and returns a list
начать обучение
rsplit()
Returns a tuple where the string is parted into three parts
начать обучение
partition()
Returns a tuple where the string is parted into three parts
начать обучение
rpartition()
Removes prefix.
начать обучение
. removeprefix()
Removes suffix.
начать обучение
. removesuffix()

Вы должны войти в свой аккаунт чтобы написать комментарий.