Python for Lifetime
BASIC DATA STRUCTURE CONCEPTS
Major Python Data Structures
List can contain values of any type as a sequence. Arrays are usually implemented in python using Lists.
A single list can contain String, integer, float at once.
Lists are mutable. Meaning, elements can be inserted, deleted or modified.
Tuples are immutable. Once created, insert, delete or modify operations cannot be done on tuple elements.
Immutability makes it useful while passing arguments to the function parameters in python ie., to *args.
Dictionary stores key-value pairs. Values could be of different data types and even contain duplicates but the key should be unique and of string data type.
Dictionary can be used to implement Hash maps.
Sets is unordered and immutable. It can store elements of different data types at once. Once created, a set can be modified.
Sets are usually used where mathematical set operations such as union or intersections are to be used on the data.
Coming up next : Python for Lifetime — LIST.
Thank for your patience.