Core Python Programming (2nd Edition)

Table B.4 contains the set of operators, (built-in and factory) functions, and built-in methods that can be used with sequence types.

Table B.4. Sequence Type Operators, Built-in Functions, and Methods

Operator, built-in function or method

str

list

tuple

[] (list creation)

 

 

()

  

""

  

append()

 

 

capitalize()

  

center()

  

chr()

  

cmp()

count()

 

decode()

  

encode()

  

endswith()

  

expandtabs()

  

extend()

 

 

find()

  

hex()

  

index()

 

insert()

 

 

isdecimal()

  

isdigit()

  

islower()

  

isnumeric()

  

isspace()

  

istitle()

  

isupper()

  

join()

  

len()

list()

ljust()

  

lower()

  

lstrip()

  

max()

min()

oct()

  

ord()

  

pop()

 

 

raw_input()

  

remove()

 

 

replace()

  

repr()

reverse()

 

 

rfind()

  

rindex()

  

rjust()

  

rstrip()

  

sort()

 

 

split()

  

splitlines()

  

startswith()

  

str()

strip()

  

swapcase()

  

split()

  

title()

  

tuple()

type()

upper()

  

zfill()

  

. (attributes)

 

[] (slice)

[:]

*

%

  

+

in

not in

Категории