Initializing Core...
Initializing Core...
Operational
Python comes with built-in data structures that make it powerful and easy to use.
fruits = ["apple", "banana", "cherry"]print(fruits[0]) # applefruits.append("mango")print(fruits) # ['apple', 'banana', 'cherry', 'mango']
Ordered, immutable, allow duplicates.
point = (10, 20)print(point[1]) # 20
Unordered, unique elements, no duplicates.
tags = {"python", "ml", "ece", "python"}print(tags) # {'ece', 'ml', 'python'}
Key-value pairs, unordered (insertion-ordered since Python 3.7).
student = {"name": "Rohan", "year": 2, "branch": "ECE"}print(student["name"]) # Rohanstudent["year"] = 3print(student) # {'name': 'Rohan', 'year': 3, 'branch': 'ECE'}