day2 a basic string manipulation python

       

 

   

  

    As long as the middle separated by spaces or special characters, numbers, special characters also

  

 

   Add up to a total of 20

 

   Six intermediate spaces, there are \ t 8 added to the foregoing, every 8-bit fill

 

Public methods:

 The results:     len () method of calculation is character

 

RESULTS:  with slices similar to care regardless of the end, "alex" as a whole

Is the slice (2,5) take less than 5

 

    "WU" is a whole, returns the index

 Find general use

Space can be considered an element

      

 

      "Al" is also a whole, count can also be sliced

 split by spaces by default do segmentation, str converted to a list

      

 

 

     The second is based on the index

 

replace: replace all default

     

 

   

The for loop is a limited circulation, while circulation belongs to an infinite loop

 

Guess you like

Origin www.cnblogs.com/wang-tan/p/10949122.html