Python's summary of strings (below)

13. Commonly used search methods

Insert picture description here

14.strip() function: remove the first and last information

Insert picture description here

15. Case conversion

Insert picture description here

16. About the formatting of strings

Center(), ljust(), rjust() these three functions are used to typeset strings
Insert picture description here

17. String formatting; padding and alignment

str.format() is used for string formatting, using {} and: instead of the previous%
padding and alignment are usually used together, ^,<,> are centered, left-aligned, and right-aligned respectively; with width at the back
: The filled character after the number can only be one character. If it is not specified, the default is a space

Insert picture description here

Insert picture description here

18. Number formatting

Insert picture description here

Guess you like

Origin blog.csdn.net/zjdzka/article/details/109205980