This presentation consists of python built in data structures and mainly concentrating on tuples and lists and a little bit of dictionaries and their operations and functions
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Python data structures (Lists and tuples) presentation
1. Python data structures
A QUICK RECAP ON INBUILT DATA STRUCTURES
PRESENTED BY:
S.VEDA GAYATHRI
B.TECH (2nd)
Electronics and Instrumentation
engineering
NIT SILCHAR
2. A QUICK GLANCE OVER:
• Data Structures
• Python data structures
• Lists
• Tuples
• Sets
• Dictionaries
3. Data structure
Data structure is a way to store and organise the data so that it can be
accessed effectively.
Eg.Dictionary
Why do we need them?
What are the different types of data structures we have?
5. LISTS
• Lists are the group of items of different types.
• Lists have the following properties such as:
Mutable
Linear data structure
Mixed type elements
Variable length
Zero based indexing
• Nested Lists can also be created.
• Syntax: Elements represented in square brackets.
• Eg. List=[1,2,3,4]
7. Tuples
• Tuples are also the group of items of different types.
• The main difference between tuples and lists is that tuples are
immutable.
• Remaining characteristics of tuples and lists are almost same .
• Syntax: Elements represented in paranthesis ().
• Eg.Tuple=(1,2,3,4)
8. Dictionaries
• Dictionary is defined using key ,value pairs enclosed in curly
braces.
• Eg: Dict={key1:’value1’, key2=‘value2’}
• Dictionaries are associated data structures. Dictionaries are
mutable.
• Keys are immutable where as values are mutable.
• Keys in dictionaries should be unique
• Dictionaries are unordered.
• Accesing of elements is done through keys not indexes.
9. Ways of creating dictionaries
Using curly brackets syntax
• With curly braces and key, index values.Dictionary={ key1:1,key2:2}
Creating empty dictionary and assign values
Using dict keyword
Using two lists of same length