Repository navigation
List, Tuples ,Dictionary
a collection which is ordered and changeable. Allows duplicate members.
A tuple is an immutable list of values. Tuples are one of Python's simplest and most common collection types, and
can be created with the comma operator (value = 1, 2, 3).
Tuple is ordered and unchangeable. Allows duplicate members.
t = 'a', 'b', 'c', 'd', 'e'
is same as
t = ('a', 'b', 'c', 'd', 'e')
t= 2, is same as t=(2)
Does't support item assignment, i.e. cannot modify exiting values or add new values to tuple. Same like strings.
t ={(1,2,3)
x, y, z = t # this is called unpacking
It is a collection which is unordered, changeable and indexed. No duplicate members. pair of key and values.
Set is a collection which is unordered and un-indexed. No duplicate members.
set = {"apple", "banana", "cherry"}
Keep Learning. Never Settle! 😊
- Home
- 1.Introduction To Python
- 2. DataTypes
- 3. Strings and Slicing of collection
- 4.If else & Loops
- 5. Break, continue, pass
- 6. Functions
- 7. Modules
- 8. Clarifying basics
- 9. File Handling
- 10. Exception Handling
- 11. Dig into Collections
- 12. Iterators, Generators and list comprehension
- 13. lambdas , map, filter and other concepts
- 14. args, kwargs an default parameters
- 15. Functional Programming
- 16. OOPs