Python seventh day of school

DBA learn a little tired today, so not a lot to learn Python boil! ! !

But no matter how bitter and more tired Python will not give up! !

Although I was the operation and maintenance!

# ! / Usr / bin / the env to python3 
# - * - Coding: UTF-. 8 - * - 
# expandtabs, punctuation 20 (\ t char character characteristic similar), can be used to produce the class table. 
Test = " username \ temail \ tpassword \ ncsdnak \ [email protected] \ T123 \ ntomcat \ [email protected] \ T123 \ ngithub \ [email protected] \ T123 " 
V = test.expandtabs (20 is )
 Print (V)
 # determines whether or not a letter, man (Python is judged genuine: True / False $ 0 in the Shell: similar 0 / nonzero properties) 
Test = " CSDN Ah Kun " 
V = test.isalpha ()
 Print (V)
 # determines whether digital, isdecimal only supports decimal digital, isdigit stronger support ② decimal numbers and types of digital, isnumeric two most powerful men to support 
the Test = " 2② two " 
v1= Test.isdecimal () 
v2 = test.isdigit () 
v3 = test.isnumeric ()
 Print (v1, v2, v3)
 # of letters, numbers, underscores: identifier, def class also in line with 
A = " DEF " 
v = A .isidentifier ()
 Print (V)
 # contains non-displayable character, for example: tab \ T, newline \ n- 
Test = " CSDN \ Tak " 
V = test.isprintable ()
 Print (V)
 # determines whether or not all there is a space or not see something, for example \ n-, \ T 
Test = " \ n- " 
V = test.isspace ()
 Print (V)
# Determine whether the title 
the Test = " the Return True IF All cased characters in UPPERCASE and there are S IS " 
v1 = test.istitle () # determine whether the title (headline criteria: the first letter of each word must be capitalized) 
Print (v1 ) 
v2 = test.title () # to convert characters to the title type 
Print (v2) 
v3 = v2.istitle () # after the judgment was founded converted to True 
Print (v3)
 # the Join, string elements splicing ***** (importance level of ※) 
Test = " sink like a stone iron unsold " 
T = '  ' 
V1 = t.join (Test)
 Print (V1) 
V2 = " " .Join (Test)
 Print (V2)
 # Just (number, symbol), fill (left / right) 
Test = " csdnak " 
V1 = test.ljust (20 is, " * " )
 Print (V1) 
V2 = Test. the rjust (20 is, " . " )
 Print (V2)
 # zfill (number) is filled, can be filled with zeros and filling is always left (usually not) just sufficient. 
V3 = test.zfill (20 is )
 Print (V3)
 # determined and converted lowercase 
Test = " Alex " 
V1 = test.lower () # all converted to lower case 
V2 = v1.islower () #Determine whether all lowercase 
Print (v2)
 # judge capitalized and converted 
v3 = test.upper () # all converted to uppercase 
V4 = v3.isupper () # determine whether all capital 
Print (V4)

 

Guess you like

Origin www.cnblogs.com/tomcache/p/11456548.html