Home » Python Datastructure

Python Datastructure

Python Dictionary

Python Dictionary

Python Dictionary is a paired collection of unordered elements, group together under one name. Dictionary can hold elements of multiple data types (Heterogenous) and elements are accessed via key indexing. You got three characteristics about python dict, which are, Paired, Unordered and Key Indexing.In the real-world scenario, we all have seen dictionary (mostly language dictionary) that relate word from one

Python Dictionary Read More »

Python sets

Python sets

SETs are an unordered collection of unique elements group together under one name. Set can hold elements of multiple data types (Heterogenous). A set will always have unique elements (no duplication allowed), unlike List and Tuples in Python. A set object is also a collection of distinct hashable objects. An object is
hashable if it has a hash value which never changes during its lifetime. Hashability

Python sets Read More »

Python tuples

python tuples by aipython

Python tuples is an ordered collection of heterogeneous data similar to List but tuple is Immutable (unchangeable). As you know, List is mutable. Any element can be modified, deleted or added to an existing list whereas once tuple is created, it can not be modified. Tuples in Python are very simple to create. Following example demonstrates one-liner method to create tuples.

Python tuples Read More »