Fourth Bibei function --python learning summary

Seven basic functions Bibei

join the set intermediate target character string is inserted into each character

split all the established character string corresponding to the target segmentation, the default from the left, can specify the number of divisions (corresponding to the delimiter is not returned after division)

Looking find the specified string from front to back at a predetermined interval to open the right, the output can not find -1. Returns the absolute value of the bit

strip around the string started simultaneously provided to remove intermediate

upper converted to uppercase

lower converted to lowercase

The string replace old (old string) replaced with new (new string), if the third argument max, max is not more than the replacement times

Magical four functions

obtaining test position return str (test on behalf of that string is not in front of the function name)

  test [3] index position

  test [0: 1] index range (0, <= x <1)

  test [0: -1] index range ( "-1" directly to the end)

Find string len number of characters

for in a string variable name (which is equivalent to the cycle while incremental step 1)

range (100,, 2) create consecutive numbers from 0 to 100 in steps of 2

 

Guess you like

Origin www.cnblogs.com/zhuqt-2008/p/11519516.html