Fourth, the string

4.1, the basic operation of the string

  1. All standard sequence of operations (index, sliced, multiplication, membership check, length, maximum, minimum) apply to strings.
  2. Strings are immutable, so all the elements of the assignment and slice assignments are illegal.

4.2, format string

  1, the operator string formatting - percent sign.

    

 

 

   2, a method using a string format ().

    

 

 

   3, width, precision, and thousands separator delimiter

    Width specified using an integer:

 

Guess you like

Origin www.cnblogs.com/nuochengze/p/12375014.html