16/08/2024
# # # **মডিউল ৬: লিস্টস, টাপলস এবং ডিকশনারিস**
**Heading: Understanding Python Data Structures: Lists, Tuples, and Dictionaries**
# # # # **১. লিস্টস (Lists):**
Python এর লিস্টস হলো একটি বহুল ব্যবহৃত ডাটা স্ট্রাকচার, যা পরিবর্তনশীল এবং বিভিন্ন ধরনের ডাটা সঞ্চয় করতে সক্ষম।
**উদাহরণ:**
```python
my_list = [1, 2, 3, 4, 5]
print(my_list)
```
**Key Points:**
- Lists are mutable, meaning you can change elements after creation.
- Lists can hold multiple data types, including strings, integers, and even other lists.
# # # # **২. টাপলস (Tuples):**
টাপলস হলো ইম্যুটেবল ডাটা স্ট্রাকচার, যা একবার তৈরি হলে আর পরিবর্তন করা যায় না।
**উদাহরণ:**
```python
my_tuple = (1, 2, 3)
print(my_tuple)
```
**Key Points:**
- Tuples are immutable; you cannot alter the elements once assigned.
- Useful for data that should remain constant throughout the program.
# # # # **৩. ডিকশনারিস (Dictionaries):**
ডিকশনারিস হলো কী-ভ্যালু পেয়ারস আকারে ডাটা সঞ্চয় করে, যা দ্রুত সার্চ ও রিট্রিভ করার জন্য কার্যকর।
**উদাহরণ:**
```python
my_dict = {'name': 'John', 'age': 25, 'city': 'New York'}
print(my_dict['name'])
```
**Key Points:**
- Dictionaries allow you to store pairs of keys and values.
- Keys must be unique and immutable, like strings or tuples.
**অ্যাসাইনমেন্ট:**
একটি লিস্ট, টাপল এবং ডিকশনারি তৈরি করে সেখানে ৩টি করে ইলিমেন্ট যোগ করুন এবং প্রিন্ট করুন।
**কুইজ:**
- একটি টাপল কিভাবে পরিবর্তন করা যায়?
- একটি ডিকশনারিতে কীসের সাথে ভ্যালু যুক্ত করা হয়?