Town Field Poem:
Cheng listens to the Tathagata language, the world name and benefit of Dayton. Be willing to do the Tibetan apostles, The broad show is by Sanfu Mention.
I would like to do what I learned, to achieve a conscience blog. May all the yimeimei, reproduce the wisdom of the Body.
——————————————————————————————————————————
Ex1:
Code
members=[[' Beidou Yang Wang greedy Wolf star June ', ' Beidou Yin Jing giant gate star June '],[' Beidou life Lu save star June ', ' Beidou Xuan Ming wen qu Xing June ', [' Beidou dan yuan-june Wang ', ' Beidou Polar Star June ', ' beidou, Guan June June ' star ']]print (members) Print () #换行 # list expanded to three times times members*=3# it seems that count can only query the elements of the list, not the elements of the list of queries list (members.count (' Beidou-day-broken Army star June ')) #这样就可以了print ( Members[2].count (' Beidou Day close the Army star June ')
Result
Ex2:
Code
#看下面的列子newmember =[' Beidou yangming Wolf star June ', ' Beidou Yin Jing giant door star June ', ' Beidou Life Lu save star June ', ' Beidou Xuan Ming wen qu Xing June ', ' Beidou dan Yuan-june ' star ', ' Beidou Polar Star June ', ' Beidou day close Broken Army star June ']print ( Newmember.count (' Beidou Day close the Army star June ') "#扩充为原来的三倍newmember *=3print (newmember.count (' Beidou Day Guan June)")
Result
——————————————————————————————————————————
The essence of the blog, in the technical part, more in the town yard a Poem. Python version 3.5, system Windows7.
Python is a good language and deserves to be studied Hard. I am following the small turtle Video tutorial to learn, Recommended.
I am a novice, so if the content of the blog can be improved, or even the wrong place, please leave a comment, I will try to correct, strive to achieve a conscience blog.
Note: This article is only as a scientific research study, if I inadvertently violated your rights and interests, please be sure to timely inform, I will make Corrections.
Python3 Base List Method Count query specifies how many times the element appears in the list