Data Structure In Python
Data Structure In Python
Today I met a problem that I would like to count the duplicate items in a list. Generally, I could iterate the list and count it by myself.
But I don’t think that’s a good idea, and python perhaps have the easiest way to do this.
So I searched for the solution and find it. there is a build-in function to do this.
1 | 'test','test','xiche','xiche','xiche',1,1,1,1,1,['a']] list_test = [ |
So it’s important to be familar with the usage of data structure in python and it will help you to code more efficient.
And let me summarize some basic operations about them and I will continue to update this article when I find some new interesting tips.
Learn to look into offical document is very import.