Day 9 learning python

Magic string

# Judge whether all the space 
test1 = "sjdhaksdhak"
test2 = ""
v1 = test1.isspace ()
v2 = test2.isspace ()
Print (v1, v2)


= test1 "i AM the Name" 
v1 = test1.title () # capitalize the first letter of the English (English title)
Print (v1)
v2 = test1.istitle () # determine whether the title (if the first letter is capitalized)
Print (V2)
V3 = v1.istitle ()
Print (V3)
 
# Say each element is spliced string specified delimiter 
test = "old boy cattle python"
Print (Test)
T = ''
V1 = t.join (Test)
V2 = "" .join (Test)
V3 = " | ".join (the Test)
Print (v1," \ the n-", v2," \ the n-", v3)










Guess you like

Origin www.cnblogs.com/jianchixuexu/p/11440521.html