Python Collection
Python Collections (Arrays)
There are four collection data types in the Python programming language:- List is a collection which is ordered and changeable. Allows duplicate members.
- Tuple is a collection which is ordered and unchangeable. Allows duplicate members.
- Set is a collection which is unordered and unindexed. No duplicate members.
- Dictionary is a collection which is unordered, changeable and indexed. No duplicate members.
List
A list is a collection which is ordered and changeable. In Python lists are written with square brackets.Example
Create a List:
thislist = ["apple", "banana", "cherry"]
print(thislist)
Python Collection
Reviewed by ohhhvictor
on
May 06, 2019
Rating:
![Python Collection](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeBzFuOvo9YiT75JJnBI2kuhB-Tr7gx0U159MPFvUSHA8L0kYvtZRq_0IXpalErBBgKdEvh7TzDBdV0WwjmQ0QvMaXvfJZMeBWUcuhY4kY2-mONd1jM8K1gRn0ynLQEtyHNaOmdgYJgDY/s72-c/py302.png)
No comments: