Thursday, September 15, 2011

Collections

Before discussiing about the Collections in Python ,we all must know the answER of one very important question ,ie; What exactly we can do with a Collection?

well there are a some basic operations which normally perform using collections :
1. Add objects to the collection.
2. Remove objects from the collection.
3. Find out if an object (or group of objects) is in the collection.
4. Retrieve an object from the collection (without removing it).
5. Iterate through the collection, looking at each element (object) one
after another.


So without wasting any time let us directly discuss the types of Collection available in Python:
1. List
2. Tuple
3. Dictionary or Hash
4. Array or Vector
5. Stack
6. Bag
7. Set

There are several merits and demerits of using different Collections which we will be discussing in our next session with programs..
Have a good day...!

No comments:

Post a Comment