Tuples

Introduction

Tuple က Python မှာ List နဲ့ တူတဲ့ Data Structure တစ်ခု။ ဒါပေမယ့် အရေးကြီးတဲ့ ကွာခြားချက် တစ်ခု ရှိတယ် အဲ့ဒါ Tuple က Immutable (ပြောင်းလဲလို့မရတာပဲ)။

ဒီ Chapter မှာ Tuple ရဲ့ အခြေခံ အားလုံးနဲ့ List နဲ့ ဘယ်လို ကွာခြားလဲဆိုတာကို တွေ့ရပါမယ်။

Tuple ဆိုတာ ဘာကောင်လဲ?

Tuple ဆိုတာ List နဲ့ တော်တော် တူတယ်။ သူလည်း ပစ္စည်းတွေကို တန်းစီထားတဲ့ သေတ္တာ ပဲ။

  • List ကို ဆောက်တုန်းက လေးထောင့်ကွင်း [] (Square Brackets) သုံးတယ်။
  • Tuple ကို ဆောက်ရင်တော့ ကွင်းစကွင်းပိတ် () (Parentheses) သုံးတယ်။

ဥပမာ:

tuple_examples.py
# ဂဏန်းတွေနဲ့ Tuple my_numbers = (10, 20, 30) # ရောသမမွှေ Tuple my_stuff = ("Laptop", 1, True, "Mouse") print(my_numbers) print(my_stuff)

Output:

Output
(10, 20, 30) ('Laptop', 1, True, 'Mouse')

Tuple Creation

Tuple ကို နည်းအမျိုးမျိုး နဲ့ ဖန်တီးလို့ရတယ်။

1. ကွင်း () နဲ့ ဆောက်တာ (အသုံးအများဆုံး):

basic_tuple.py
my_tuple = (1, 2, 3) print(my_tuple)

2. ကွင်း မပါဘဲ ကော်မာ (,) ခံပြီး ရေးတာ:

tuple_without_parentheses.py
# ဒါက Pro Tip another_tuple = "a", "b", "c" print(another_tuple) # Output က ('a', 'b', 'c') ပဲ

Output:

Output
('a', 'b', 'c')

3. Single Element Tuple (တစ်ခုတည်း ပါတဲ့ Tuple):

single_element_tuple.py
# သတိထား: Trailing comma (,) က အရေးကြီးတယ်! single = (5,) # ဒါက Tuple not_tuple = (5) # ဒါက ဂဏန်း 5 ပဲ print(type(single)) # <class 'tuple'> print(type(not_tuple)) # <class 'int'>
Single Element Tuple: တစ်ခုတည်း ပါတဲ့ Tuple ဆောက်ချင်ရင် trailing comma (,) ကိုလုံးဝ မမေ့နဲ့။ မဟုတ်ရင် Python က Tuple အဖြစ် မသတ်မှတ်ဘူး။

4. Empty Tuple (ဗလာ Tuple):

empty_tuple.py
empty_tuple = () print(empty_tuple) print(len(empty_tuple)) # 0

List နဲ့ တူတဲ့ အချက်

List မှာ လုပ်ခဲ့တဲ့ Indexing (တစ်ခုချင်း ယူတာ) နဲ့ Slicing (အပိုင်းလိုက် လှီးတာ) တွေ... Tuple မှာလည်း တစ်ပုံစံတည်း လုပ်လို့ရတယ်။

Indexing:

tuple_indexing.py
my_tuple = ("ပန်းသီး", "လိမ္မော်", "ငှက်ပျော", "စပျစ်") # Index: 0 1 2 3 # Indexing (ယူမယ်) print(my_tuple[0]) # Output: "ပန်းသီး" print(my_tuple[-1]) # Output: "စပျစ်"

Output:

Output
ပန်းသီး စပျစ်
သတိ: Tuple မှာလည်း Index က 0 ကနေ စတယ်။ List နဲ့ အတူတူပဲ။

Slicing (လှီးတာ):

tuple_slicing.py
my_tuple = ("ပန်းသီး", "လိမ္မော်", "ငှက်ပျော", "စပျစ်") # Slicing (လှီးမယ်) print(my_tuple[1:3]) # Output: ("လိမ္မော်", "ငှက်ပျော") print(my_tuple[:2]) # အစကနေ 2 ခု print(my_tuple[2:]) # Index 2 ကနေ အဆုံးထိ

Output:

Output
('လိမ္မော်', 'ငှက်ပျော') ('ပန်းသီး', 'လိမ္မော်') ('ငှက်ပျော', 'စပျစ်')

Other Similar Operations:

tuple_operations.py
my_tuple = (1, 2, 3, 4, 5) # Length (အရေအတွက်) print(len(my_tuple)) # 5 # Loop နဲ့ ပတ်လို့ရတယ် for item in my_tuple: print(item) # in operator နဲ့ စစ်လို့ရတယ် print(3 in my_tuple) # True

ဒါဆို bro တွေးမိလိမ့်မယ်။ ဟ... List နဲ့ တူတူပဲဆိုတော့၊ ဘာလို့ Tuple ကို အရှုပ်ခံပြီး သုံးနေသေးလဲ။

အဲ့ဒါက အခုလာမယ့် အဓိက အကြောင်းအရာ Immutability ကြောင့်ပဲ။

အဓိက ကိစ္စ: Immutability (ပြင်လို့မရတာ)

ဒါက Tuple ရဲ့ နှလုံးသား ပဲ။

Immutable ဆိုတာ မပြောင်းလဲနိုင်သော၊ ပြင်ဆင်လို့ မရသော လို့ အဓိပ္ပာယ်ရတယ်။

CRITICAL: Tuples are IMMUTABLE! Tuple ကို တစ်ခါ ဆောက်ပြီးရင် ထည့်လို့ မရ၊ ဖျက်လို့ မရ၊ ပြင်လို့ မရဘူး။ ဒါက Tuple ရဲ့ အဓိက main ပဲ။

bro ကိုပြောပြရမယ်ဆို:

List ဆိုတာ Whiteboard နဲ့တူတယ်။

  • bro ကြိုက်တာ ရေးလို့ရတယ်။ (.append)
  • မကြိုက်ရင် ဖျက်လို့ရတယ်။ (.pop, .remove)
  • ရှိပြီးသားကို ပြင်လို့ရတယ်။ (my_list[0] = "New")

Tuple ဆိုတာ ကျောက်စာ နဲ့တူတယ်။

  • တစ်ခါ ထွင်းပြီးသွားရင်... အသေပဲ။
  • ထပ်ထည့်လို့ မရဘူး။
  • ဖျက်လို့ မရဘူး။
  • ပြင်လို့ မရဘူး။

စမ်းကြည့်မယ်:

List မှာဆို ဒီလို ပြင်လို့ရတယ်:

list_mutable.py
my_list = [1, 2, 3] my_list[0] = 100 # Index 0 ကို 100 ပြောင်းမယ် my_list.append(4) # 4 ကို ထပ်ထည့်မယ် print(my_list) # Output: [100, 2, 3, 4] အေးဆေးပဲ

Output:

Output
[100, 2, 3, 4]

Tuple မှာ အဲ့လို ကလိကြည့်ရအောင်:

tuple_immutable_error.py
my_tuple = (1, 2, 3) # ကဲ... Index 0 ကို 100 ပြောင်းကြည့်မယ် try: my_tuple[0] = 100 # <--- ဒီမှာ သွားပြီ except TypeError as e: print(f"Error: {e}") print("Tuple ကို ပြင်လို့ မရဘူး!")

Output:

Output
Error: 'tuple' object does not support item assignment Tuple ကို ပြင်လို့ မရဘူး!

Python က Error ပေးလိမ့်မယ်:

TypeError: 'tuple' object does not support item assignment

Tuple Methods အကန့်အသတ် ရှိ

.append(), .pop(), .remove()... List မှာ သုံးခဲ့တဲ့ Methods တွေ Tuple မှာ တစ်ခုမှ သုံးလို့ မရဘူး။

Tuple မှာ Methods နှစ်ခုပဲ ရှိတယ်:

1. .count(item) - Item က ဘယ်နှခု ရှိလဲ ရေတယ်

tuple_count.py
my_tuple = (1, 2, 2, 3, 2, 4) count_of_2 = my_tuple.count(2) print(f"2 က {count_of_2} ခါ ရှိတယ်")

Output:

Output
2 က 3 ခါ ရှိတယ်

2. .index(item) - Item က ဘယ် Index မှာ ရှိလဲ

tuple_index.py
fruits = ("ပန်းသီး", "လိမ္မော်", "ငှက်ပျော") position = fruits.index("လိမ္မော်") print(f"လိမ္မော် က Index {position} မှာ ရှိတယ်")

Output:

Output
လိမ္မော် က Index 1 မှာ ရှိတယ်

List ရဲ့ Methods တွေကို Tuple မှာ သုံးလို့ မရဘူး:

tuple_no_methods.py
my_tuple = (1, 2, 3) # ဒီ methods တွေ Tuple မှာ မရှိဘူး try: my_tuple.append(4) # AttributeError! except AttributeError: print("append() က Tuple မှာ မရှိဘူး") try: my_tuple.remove(1) # AttributeError! except AttributeError: print("remove() က Tuple မှာ မရှိဘူး") try: my_tuple.pop() # AttributeError! except AttributeError: print("pop() က Tuple မှာ မရှိဘူး")

Output:

Output
append() က Tuple မှာ မရှိဘူး remove() က Tuple မှာ မရှိဘူး pop() က Tuple မှာ မရှိဘူး

ဘာလို့ ပြင်လို့မရတာကို သုံးရတာလဲ bro?

Tuple သုံးရတဲ့ အကြောင်း: Tuple က Immutable ဖြစ်တဲ့အတွက် အားသာချက် အများကြီး ရှိတယ်။

1. Safety (ဘေးကင်းဖို့):

bro အလေးထားတဲ့ data တွေကို (ဥပမာ: GPS တည်နေရာ (10.123, 20.456)) မှားပြီး ကလိမိ၊ ပြင်မိမှာ မစိုးရိမ်ရတော့ဘူး။ ကျောက်စာလို သတ်မှတ်ထားလိုက်တာ။

safety_example.py
# GPS Coordinates - မှားပြင်မိလို့ မရဘူး location = (16.8661, 96.1951) # Yangon # ဘေးကင်းတယ် - ဘယ်သူမှ မှားပြီး မပြောင်းနိုင်ဘူး print(f"Latitude: {location[0]}, Longitude: {location[1]}")

2. ပိုမြန်တယ်:

သူက ပြင်လို့ မရအောင် fix လုပ်ထားတဲ့အတွက်၊ Python က သူ့ကို List ထက် ပို ပေါ့ပေါ့ပါးပါးနဲ့ မြန်မြန် ကိုင်တွယ်နိုင်တယ်။ နည်းနည်းပဲ မြန်တာပါ၊ ဒါပေမယ့် ကွာတာတော့ ကွာတယ်။

3. Dictionary Keys:

Tuple တွေကို Dictionary ရဲ့ Key အဖြစ် သုံးလို့ရတယ်။ List တွေကို Dictionary Key အဖြစ် သုံးလို့ မရဘူး (Immutable ဖြစ်ရမယ်)။

tuple_as_key.py
# Tuple ကို Dictionary key အဖြစ် သုံးလို့ရတယ် locations = { (16.8661, 96.1951): "Yangon", (21.9162, 95.9560): "Mandalay" } print(locations[(16.8661, 96.1951)])

Output:

Output
Yangon

4. Data Integrity:

Function ကနေ ပြန်ပေးတဲ့ values တွေကို မပြောင်းစေချင်ရင် Tuple သုံးတယ်။

data_integrity.py
def get_user_info(): # User info ကို Tuple အနေနဲ့ ပြန်ပေးမယ် # ဘယ်သူမှ မပြောင်းစေချင်လို့ return ("ကို chou", 25, "Developer") user = get_user_info() print(user) # ('ကို chou', 25, 'Developer')

Packing and Unpacking

Tuple Packing (ထုပ်ပိုးခြင်း):

Packing ဆိုတာ values တွေကို Tuple တစ်ခု အဖြစ် အလိုလို စုပေါင်းသွားတာ။

tuple_packing.py
# Packing - ကွင်း () မပါဘဲ comma ခံရုံနဲ့ Tuple ဖြစ်သွားတယ် coordinates = 10.5, 20.3, 30.7 print(coordinates) print(type(coordinates))

Output:

Output
(10.5, 20.3, 30.7) <class 'tuple'>

Tuple Unpacking ပြန်ဖြည်:

Unpacking ဆိုတာ သေတ္တာ (Tuple) ထဲက ပစ္စည်းတွေကို တစ်ခုချင်း ဆွဲထုတ်ပြီး နာမည်ပေးထားတဲ့ ပုံးတွေ (Variables) ထဲကို တစ်ပြိုင်နက် ထည့်လိုက်တာ။

Unpacking အလန်းစား: ဒါက Tuple မှာ (List မှာလည်း ရတယ်) လုပ်လို့ရတဲ့ ကစားကွက် အလန်း။

အခြေခံ Unpacking:

ဥပမာ bro မှာ data တစ်ခု ရှိတယ် ဆိုပါစို့။

basic_unpacking.py
# (နာမည်, အသက်, အလုပ်) user_data = ("ကို chou", 30, "Developer") # နဂို ဆိုရင် ဒီလို ယူရမယ် # name = user_data[0] # age = user_data[1] # job = user_data[2] # Unpacking နဲ့ ဆိုရင်... တစ်ကြောင်းတည်းပဲ name, age, job = user_data # အခု စစ်ကြည့် print(name) # Output: "ကို chou" print(age) # Output: 30 print(job) # Output: "Developer"

Output:

Output
ကို chou 30 Developer

user_data ထဲက ၃ ခု က name, age, job ဆိုတဲ့ variables တွေထဲကို သူ့အစဉ်လိုက် အလိုလို ဝင်သွားတာ။

Extended Unpacking (with *):

* (asterisk) သုံးရင် ကျန်တဲ့ items တွေ အကုန်လုံးကို List အဖြစ် ယူလို့ရတယ်။

extended_unpacking.py
numbers = (1, 2, 3, 4, 5) # ပထမ နဲ့ အနောက်ဆုံး ယူမယ်၊ ကြားက အကုန် rest ထဲထည့်မယ် first, *rest, last = numbers print(f"First: {first}") print(f"Rest: {rest}") print(f"Last: {last}")

Output:

Output
First: 1 Rest: [2, 3, 4] Last: 5

Underscore (_) for Ignoring Values:

မလိုအပ်တဲ့ values တွေကို _ (underscore) နဲ့ လျစ်လျူရှုလို့ရတယ်။

ignore_values.py
user_data = ("ကို chou", 30, "Developer", "Yangon") # နာမည် နဲ့ အလုပ်ပဲ လိုချင်တယ်၊ ကျန်တာ မလို name, _, job, _ = user_data print(f"Name: {name}") print(f"Job: {job}")

Output:

Output
Name: ကို chou Job: Developer

Swapping Values (တန်ဖိုးတွေ လဲမယ်):

Tuple Packing/Unpacking ကို သုံးပြီး variables နှစ်ခုရဲ့ values ကို လွယ်လွယ်ကူကူ လဲလို့ရတယ်။

swapping.py
a = 10 b = 20 print(f"Before: a={a}, b={b}") # Swap a, b = b, a print(f"After: a={a}, b={b}")

Output:

Output
Before: a=10, b=20 After: a=20, b=10

Nested Tuples (Tuple ထဲက Tuple)

Tuple ထဲမှာ နောက်ထပ် Tuple ထပ်ထည့်လို့ရတယ်။

nested_tuples.py
# Nested Tuple - Tuple ထဲမှာ Tuple matrix = ( (1, 2, 3), (4, 5, 6), (7, 8, 9) ) # အတွင်းက Tuple ကို ယူမယ် print(matrix[0]) # (1, 2, 3) print(matrix[1][2]) # 6 # Loop နဲ့ ပတ်မယ် for row in matrix: for item in row: print(item, end=" ") print()

Output:

Output
(1, 2, 3) 6 1 2 3 4 5 6 7 8 9

Type Conversion

Tuple ကို List အဖြစ်၊ List ကို Tuple အဖြစ် ပြောင်းလို့ရတယ်။

Tuple → List:

tuple_to_list.py
my_tuple = (1, 2, 3, 4) print(f"Tuple: {my_tuple}") # Tuple ကို List အဖြစ် ပြောင်းမယ် my_list = list(my_tuple) print(f"List: {my_list}") # အခု List ဖြစ်သွားပြီ - ပြင်လို့ရပြီ my_list.append(5) print(f"Modified List: {my_list}")

Output:

Output
Tuple: (1, 2, 3, 4) List: [1, 2, 3, 4] Modified List: [1, 2, 3, 4, 5]

List → Tuple:

list_to_tuple.py
my_list = ["a", "b", "c"] print(f"List: {my_list}") # List ကို Tuple အဖြစ် ပြောင်းမယ် my_tuple = tuple(my_list) print(f"Tuple: {my_tuple}") # အခု Tuple ဖြစ်သွားပြီ - ပြင်လို့ မရတော့ဘူး try: my_tuple[0] = "x" except TypeError: print("Tuple ကို ပြင်လို့ မရဘူး")

Output:

Output
List: ['a', 'b', 'c'] Tuple: ('a', 'b', 'c') Tuple ကို ပြင်လို့ မရဘူး

Practical Example: Function Returning Multiple Values

Function တစ်ခုက တန်ဖိုး အများကြီး ပြန်ပေးချင်ရင် Tuple သုံးပေါ့။ ဒါက Python မှာ အသုံးအများဆုံး pattern ပဲ။

multiple_return_values.py
def calculate_statistics(numbers): """ဂဏန်းတွေရဲ့ အငယ်ဆုံး၊ အကြီးဆုံး၊ ပျမ်းမျှ တွက်မယ်""" minimum = min(numbers) maximum = max(numbers) average = sum(numbers) / len(numbers) # Tuple အဖြစ် တန်ဖိုး ၃ ခု ပြန်ပေးမယ် return minimum, maximum, average # Tuple packing # Function ကို ခေါ်မယ် data = [10, 20, 30, 40, 50] min_val, max_val, avg_val = calculate_statistics(data) # Tuple unpacking print(f"အငယ်ဆုံး: {min_val}") print(f"အကြီးဆုံး: {max_val}") print(f"ပျမ်းမျှ: {avg_val}")

Output:

Output
အငယ်ဆုံး: 10 အကြီးဆုံး: 50 ပျမ်းမျှ: 30.0

ဒါ Python မှာ common pattern ပဲ။ Function တစ်ခုက တန်ဖိုး အများကြီး return လုပ်ချင်ရင် Tuple သုံးတယ်။

ဘယ်တော့ Tuple သုံးမလဲ? ဘယ်အခါ List သုံးမလဲ?

Tuple vs List: Data Structure တွေကို ရွေးမှန်ဖို့ကလည်း အရေးကြီးတယ်။

Tuple သုံးသင့်တဲ့ အခြေအနေများ:

  • Fixed Data: Data က ပြောင်းမှာ မဟုတ်ဘူးဆိုတဲ့ခါ (ဥပမာ: RGB color (255, 128, 0))
  • Safety: မှားပြီး ပြင်မိတာမျိုး မဖြစ်စေချင်ရင်
  • Dictionary Keys: Dictionary ရဲ့ key အဖြစ် သုံးချင်ရင်
  • Function Returns: Function က တန်ဖိုး အများကြီး return လုပ်ချင်ရင်
  • Performance: Speed နည်းနည်း အရေးကြီးရင်
  • Heterogeneous Data: data type အမျိုးမျိုး ပါတဲ့ခါ (နာမည်, အသက်, အလုပ်)

List သုံးသင့်တဲ့နေရာက:

  • Dynamic Data: Data က ပြောင်းလဲမယ် (ထည့်၊ ဖျက်၊ ပြင်)
  • Same Type: တူညီတဲ့ data အမျိုးအစားတွေ (ဈေးဝယ်စာရင်း)
  • Need Methods: append, remove, sort စတဲ့ methods လိုအပ်ရင်
  • Unknown Size: ဘယ်နှခု ထည့်ရမလဲ ကြိုမသိရင်

Examples:

when_to_use.py
# Tuple သုံးသင့်တယ် - Fixed data rgb_color = (255, 128, 0) # Orange color coordinates = (16.8661, 96.1951) # Yangon date = (2024, 3, 15) # Year, Month, Day # List သုံးသင့်တယ် ဒီနေရာမှာ shopping_list = ["ဒူးရင်းသီး", "ကိုလာ", "ရေခဲမုန့်"] shopping_list.append("နို့") # ထပ်ထည့်လို့ရတယ် grades = [85, 90, 78] grades.sort() # စီလို့ရတယ်

Tuple vs List: နှိုင်းယှဉ်ချက်

Comparison Table
================================================================================ Feature | Tuple | List ================================================================================ Syntax | () | [] Mutable | No (Immutable) | Yes (Mutable) Speed | Faster | Slower Memory | Less | More Methods | count(), index() | append(), pop(), remove(), etc. Dictionary Key | Yes | No Use Case | Fixed data | Dynamic data Example | (1, 2, 3) | [1, 2, 3] ================================================================================
side_by_side_comparison.py
print("=== Tuple ===") my_tuple = (1, 2, 3) print(f"Type: {type(my_tuple)}") print(f"Can modify? No") print(f"Methods: count(), index()") print("\n=== List ===") my_list = [1, 2, 3] print(f"Type: {type(my_list)}") print(f"Can modify? Yes") print(f"Methods: append(), pop(), remove(), sort(), etc.")

လေ့ကျင့်ဖို့

Exercise 1: Tuple Basics

exercise1.py
# TODO: # 1. Tuple တစ်ခု ဆောက်ကြည့် - သစ်သီး 4 မျိုး ထည့် # 2. ပထမဆုံး သစ်သီး နဲ့ အနောက်ဆုံး သစ်သီး ကို print ထုတ် # 3. Tuple ထဲမှာ သစ်သီး ဘယ်နှမျိုး ရှိလဲ print ထုတ် # 4. Tuple ကို ပြောင်းပြန်လှန်ပြီး print ထုတ်စမ်းကြည့် (slicing သုံး)

Exercise 2: Tuple Unpacking

exercise2.py
student_info = ("မောင်မောင်", 20, "Computer Science", 3.8) # TODO: # 1. Tuple ကို unpack လုပ်ပြီး variables ခွဲထုတ် # 2. ကျောင်းသား အချက်အလက် အကုန်လုံးကို print ထုတ်စမ်းကြည့်

အနှစ်ချုပ်

Tuple ဆိုတာ:

  • List နဲ့ ဆင်တယ်၊ ဒါပေမယ့် Immutable (ပြောင်းလို့မရ)
  • ကွင်း () (Parentheses) နဲ့ ဆောက်တယ်
  • ကျောက်စာ လို - တစ်ခါ ရေးပြီးရင် ပြင်လို့မရတော့ဘူး

အခြေခံ Operations:

  • Creation: my_tuple = (1, 2, 3) သို့မဟုတ် 1, 2, 3
  • Indexing: my_tuple[0] (0 ကနေ စတယ်)
  • Slicing: my_tuple[1:3]
  • Cannot Modify: my_tuple[0] = 100 လုပ်လို့ မရဘူး

Tuple Methods (နှစ်ခုပဲ ရှိတယ်):

  • count() - Item ဘယ်နှခု ရှိလဲ
  • index() - Item ဘယ် Index မှာ ရှိလဲ

Unpacking (အလန်းစား):

  • Basic: name, age, job = my_tuple
  • Extended: first, *rest, last = my_tuple
  • Ignore: name, _, job, _ = my_tuple

ဘာကြောင့် Tuple သုံးမှာလဲ?

  • Safety: မှားပြီး ပြင်မိမှာ မစိုးရိမ်ရဘူး
  • Speed: List ထက် မြန်တယ်
  • Dictionary Keys: Key အဖြစ် သုံးလို့ရတယ်
အိုကေ။ Tuple က List ထက် ရိုးရှင်းပေမယ့် အရေးကြီးတယ်။ Immutable ဖြစ်တဲ့အတွက် Safety နဲ့ Performance ကောင်းတယ်။ ဘယ်အချိန် Tuple သုံးမလဲ၊ ဘယ်အခါ List သုံးမလဲ သိပြီဆိုရင် Python မှာ ပိုကောင်းမွန်တဲ့ Code တွေ ရေးလို့ရမယ်။

Quick Reference

tuple_reference.py
# Creation my_tuple = (1, 2, 3) another_tuple = 1, 2, 3 single = (5,) empty = () # Indexing & Slicing my_tuple[0] my_tuple[-1] my_tuple[1:3] # Methods my_tuple.count(2) my_tuple.index(3) # Packing & Unpacking coords = 10, 20 x, y = coords first, *rest, last = my_tuple name, _, age = ("John", 25, 30) # Conversion list(my_tuple) tuple(my_list) # Immutable - Cannot do these: # my_tuple[0] = 100 # TypeError! # my_tuple.append(4) # AttributeError! # my_tuple.remove(1) # AttributeError!