Python 019 study notes

String Manipulation

= A "the let apos Go" 
Print (A)

# repeatedly output
Print (A * 2)

# acquired character string by an index, corresponding to the slice
Print (A [ 2:])

# judging operation, the keyword in the string, returns True / False
Print ( 'et' in A)

# format string
Print ( '% S IS A Teacher'% 'Kevin')

# string concatenation, + inefficient, .join high efficiency, can be customized
A = ' 123 '
B = ' ABC '
C = A + B
Print (C)

D = ' --- '. the Join ([A, B, C])
Print (D)

Built-in method

 

Guess you like

Origin www.cnblogs.com/wtzxxy/p/12422959.html