First:
Capitalize (self):
Illustration:
A1 = "Alex"
tmp = a1.capitalize ()
Print (TMP)
Output: Alex
String parameter Description: Capitalize (), capitalize the first letter of the string.
Second:
Center ()
Example Description:
A1 = "Alex"
tmp = A1.center ("_")
Print (TMP)
Output: _______alex_______
String parameter Description: Center () set the total length of 20 characters, Alex is 4, set 20, then center the center, fill in front and back blank ___
Third:
count ()
Example Description:
A1 = "Alex is Algood"
tmp = A1.count ("Al") or TMP = A1.count ("Al", 0,4/10)
Print (TMP)
Output: The first output A1 appears two times, the second result appears 1 times/2 times
String parameter Description: Count () Number of subsequence, From left to right to find the number of Al, you can specify the number of times from the first to the first several, 0,4 set from No. 0 to fourth Al, there were several times, apparently only 1 times/10,0,10 from No. 0 to 10th, Al appeared several times, apparently appeared 2 times. (Space is also a location)
Python basic data type-string parameter (learning Note)