Thuta Learning
Python
ExercisesProgrammingအခြေခံ

Exercise Set 2: Intermediate Practice (OOP, Files, Errors, Comprehensions)

Pythonသင်ခန်းစာ 7045 မိနစ်

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Method တွေထဲမှာ input ကို စစ်ပြီး class ရဲ့ state မမှန်ကန်အောင် မဖြစ်စေနိုင်ဖို့
  • Data ပါတဲ့ custom exception ကို ဖန်တီးပြီး raise/except လုပ်နိုင်ဖို့
  • try / except / else / finally block တစ်ခုစီ ဘယ်အချိန် run လဲ ခန့်မှန်းနိုင်ဖို့
  • with နဲ့ encoding ပေးပြီး file ဖတ်/ရေးကာ tempfile နဲ့ test လုပ်နိုင်ဖို့
  • Dict comprehension နဲ့ sorted(key=...) ကို ပေါင်းသုံးနိုင်ဖို့

ရိုးရိုးလေး ရှင်းပြမယ်

ရိုးရိုးလေး ရှင်းရရင်

Exercise Set 1 က note တစ်လုံးချင်း တီးတာကို လေ့ကျင့်တာဆိုရင် Set 2 က chord တွေ တီးတာပါ။ Intermediate chapter တွေက class၊ error handling၊ file handling နဲ့ comprehension တွေကို ဒီ task တွေထဲမှာ ပေါင်းသုံးရပါတယ်။

Project အစစ်တွေမှာ concept တစ်ခုတည်းနဲ့ အလုပ်လုပ်ရတာ ရှားပါတယ်။ Bank app တစ်ခုက account class တစ်ခု၊ ငွေမလောက်တဲ့အခါ exception တစ်ခု၊ statement သိမ်းဖို့ file တစ်ခုကို တစ်ပြိုင်နက် သုံးပါတယ်။ ဒီ task တွေကို ကိုယ်တိုင် ဖြေရှင်းပြီး run ကြည့်ရင် debugging skill ပါ ထက်လာပါလိမ့်မယ်။

Problem → Why → Solution

ပြဿနာ: happy path မှာပဲ အလုပ်လုပ်တဲ့ code

အောက်က draft ကို ပုံမှန် value တွေနဲ့ run ရင် အဆင်ပြေပါတယ်။ ဒါပေမယ့် withdraw(-50) ကို ခေါ်ကြည့်ပါ။ -50 က balance ထက် မကြီးလို့ check ကို ကျော်ပြီး balance -= -50 က balance ကို 150 ဖြစ်စေပါတယ်။ "ငွေထုတ်တာ" က ငွေထည့်သွားပါတယ်။

ငွေမလောက်တဲ့အခါ class က message ကို print လုပ်ပြီး return ပြန်လို့ ခေါ်တဲ့ code က ငွေထုတ်တာ အောင်မြင်လား မသိနိုင်ပါဘူး။ File အပိုင်းမှာ notes.txt မရှိရင် program ရပ်သွားပြီး ဖတ်နေတုန်း error ဖြစ်ရင် file ကို ဘယ်တော့မှ မပိတ်ပါဘူး။

draft.py
class BankAccount:
    def __init__(self, balance=0):
        self.balance = balance

    def withdraw(self, amount):
        if amount > self.balance:
            print("Not enough balance!")   # the caller cannot tell it failed
            return
        self.balance -= amount             # withdraw(-50) adds 50

acc = BankAccount(100)
acc.withdraw(-50)
f = open("notes.txt")                      # crashes if missing, never closed
print(f.read())

ဘာကြောင့် ဒီလို ဖြစ်တာလဲ

Draft က "ဘာတွေ မှားသွားနိုင်လဲ" ဆိုတဲ့ မေးခွန်းကို မမေးခဲ့ပါဘူး။ Class က သူ့ state ကို မစောင့်ရှောက်ဘဲ error ကို exception အစား print နဲ့ ဖော်ပြပြီး file ရဲ့ cleanup ကို ကံကောင်းမှုပေါ် ထားခဲ့ပါတယ်။ Happy path တစ်ကြိမ် run ရုံနဲ့ ဒီ failure path သုံးခုလုံး ဘယ်တော့မှ မပေါ်ပါဘူး။

Core concept: state၊ failure နဲ့ cleanup ကို ကြိုစီစဉ်ပါ

Intermediate task တစ်ခုကို မစခင် မေးခွန်းသုံးခု မေးပါ။ State ကို ဘယ်သူ ပိုင်လဲ။ ဘာတွေ fail ဖြစ်နိုင်လဲ။ ဘာက အမြဲ ဖြစ်ရမလဲ (cleanup)။ ဒီ lesson ရဲ့ task သုံးခုက ဒီမေးခွန်းတွေကို တစ်ခုစီ ဖြေပါတယ်။

၁။ Class က သူ့ state ကို စောင့်ရှောက်ပါတယ်

balance ကို ပြောင်းနိုင်တာ deposit() နဲ့ withdraw() ပဲ ဖြစ်လို့ စစ်ဆေးမှုတွေကို အဲဒီ method တွေထဲမှာ ထားပါ။ Amount က 0 ဒါမှမဟုတ် အနှုတ်ဆိုရင် ValueError raise လုပ်ပါ။ ဒါဆို program ရဲ့ ဘယ်နေရာကမှ balance ကို မှားယွင်းတဲ့ အခြေအနေ မရောက်စေနိုင်ပါဘူး။

၂။ Print မလုပ်ဘဲ raise လုပ်ပါ

Exception ကို subclass လုပ်ပြီး InsufficientFundsError ကို ဖန်တီးပါ။ Balance နဲ့ amount ကို attribute အဖြစ် သယ်ထားလို့ ခေါ်တဲ့သူက ဘယ်လို တုံ့ပြန်မလဲ ဆုံးဖြတ်နိုင်ပါတယ်။ Command-line app က message print ထုတ်နိုင်ပြီး web app က 4xx response ပြန်နိုင်ပါတယ်။ Class က ဘယ် interface ကနေ ခေါ်ခံရလဲ သိစရာ မလိုပါဘူး။

၃။ try / except / else / finally

except ထဲမှာ မျှော်လင့်ထားတဲ့ exception ကိုပဲ ရေးပါ။ finally က exception ဖြစ်ဖြစ်၊ return ရှိရှိ အမြဲ run ပါတယ်။ ဒါကြောင့် example ရဲ့ ဒုတိယ read မှာ "Read attempt finished" က caller ရဲ့ "First line" မတိုင်ခင် ထွက်ပါတယ်။ File ပိတ်တာလို cleanup အတွက်တော့ with statement က ပိုရှင်းပါတယ်၊ block ကနေ ဘယ်လိုထွက်ထွက် file ကို ပိတ်ပေးပါတယ်။

၄။ File တွေကို ရှင်းရှင်း ဖွင့်ပါ

encoding="utf-8" ကို အမြဲ ပေးပါ။ Default encoding က Python version နဲ့ platform ပေါ် မူတည်လို့ Myanmar စာ ပါတဲ့ file က computer တစ်လုံးမှာ ဖတ်လို့ရပြီး နောက်တစ်လုံးမှာ UnicodeDecodeError ဖြစ်နိုင်ပါတယ်။ FileNotFoundError က OSError ရဲ့ subclass ပါ။ Test တွေမှာ tempfile.TemporaryDirectory() ကို သုံးရင် file အစစ်တွေကို မထိဘဲ အဆုံးမှာ အလိုလို ရှင်းပေးပါတယ်။

၅။ Comprehension နဲ့ sort

{w: len(w) for w in words} က dictionary ကို expression တစ်ခုတည်းနဲ့ ဆောက်ပါတယ်။ sorted(..., key=lambda item: item[1]) က length နဲ့ စီပြီး sorted() က stable ဖြစ်လို့ length တူတဲ့ word တွေက မူလ အစီအစဉ်အတိုင်း ကျန်ပါတယ်။

Blockဘယ်အချိန် run လဲ
tryအရင်ဆုံး
except Xtry ထဲမှာ X (ဒါမှမဟုတ် subclass) raise ဖြစ်မှ
elsetry ထဲမှာ exception မဖြစ်မှ
finallyအမြဲ၊ return ဒါမှမဟုတ် မဖမ်းရတဲ့ exception ရှိရင်တောင်
Mental model: ဘာမှားနိုင်လဲ အရင်မေး
  1. State ကို ဘယ်သူ ပိုင်လဲ ဆုံးဖြတ်
  2. Fail ဖြစ်နိုင်တာတွေ စာရင်းလုပ်
  3. တိကျတဲ့ exception ကို raise
  4. with / finally နဲ့ cleanup
  5. Failure path တွေကိုပါ test

Happy path က code ရဲ့ တစ်ဝက်ပဲ ဖြစ်ပါတယ်။ ကျန်တစ်ဝက်က မှားသွားတဲ့အခါ ဘာဖြစ်မလဲ ဆိုတာပါ။

အခြေခံ ပုံစံ

python
class DomainError(Exception):
    pass

try:
    result = risky_operation()
except DomainError as err:
    handle(err)
else:
    use(result)
finally:
    clean_up()

ကိုယ်ပိုင် exception class ကို ဖန်တီး၊ မျှော်လင့်ထားတဲ့ error ကိုပဲ ဖမ်း၊ အောင်မြင်တဲ့ code ကို else ထဲထား၊ cleanup ကို finally ထဲ ထားပါ။

Task သုံးခုရဲ့ အဖြေ (deterministic version)

လက်ရှိ folder ထဲက notes.txt ကို ဖတ်ရင် ရလဒ်က script ကို ဘယ်ကနေ run လဲ ပေါ်မူတည်သွားပါမယ်။ ဒါကြောင့် code က temporary folder တစ်ခုထဲမှာ file မရှိတဲ့ case နဲ့ ရှိတဲ့ case နှစ်ခုလုံးကို စမ်းလို့ output က အမြဲ တူပါတယ်။ BankAccount ကလည်း amount အနှုတ်ကို ငြင်းပြီး InsufficientFundsError က balance နဲ့ amount ကို သယ်ထားပါတယ်။

intermediate_practice.py
import os
import tempfile


# Task 1: BankAccount with a custom exception
class InsufficientFundsError(Exception):
    def __init__(self, balance, amount):
        super().__init__(f"cannot withdraw {amount}, balance is {balance}")
        self.balance = balance
        self.amount = amount


class BankAccount:
    def __init__(self, balance=0):
        self.balance = balance

    def deposit(self, amount):
        if amount <= 0:
            raise ValueError(f"amount must be positive, got {amount}")
        self.balance += amount

    def withdraw(self, amount):
        if amount <= 0:
            raise ValueError(f"amount must be positive, got {amount}")
        if amount > self.balance:
            raise InsufficientFundsError(self.balance, amount)
        self.balance -= amount


acc = BankAccount(1000)
acc.deposit(500)
try:
    acc.withdraw(2000)
except InsufficientFundsError as e:
    print(f"Error: {e}")
finally:
    print(f"Current balance: {acc.balance}")

try:
    acc.deposit(-50)
except ValueError as e:
    print(f"Error: {e}")


# Task 2: safe file read - try/except/finally around open()
def read_first_line(path):
    try:
        with open(path, encoding="utf-8") as f:
            return f.readline().strip()
    except FileNotFoundError:
        print(f"File not found: {os.path.basename(path)} - please check the name.")
        return None
    finally:
        print("Read attempt finished")


with tempfile.TemporaryDirectory() as folder:
    notes = os.path.join(folder, "notes.txt")
    read_first_line(notes)                      # file does not exist yet
    with open(notes, "w", encoding="utf-8") as f:
        f.write("Buy milk\nCall Ko Ko\n")
    print("First line:", read_first_line(notes))


# Task 3: dict comprehension, then sort by length
words = ["python", "is", "fun", "and", "powerful"]
word_lengths = {w: len(w) for w in words}
by_length = dict(sorted(word_lengths.items(), key=lambda item: item[1]))
print(by_length)

Code ကို တစ်ပိုင်းချင်း ရှင်းပြမယ်

  1. An exception that carries datasuper().__init__(f"cannot withdraw {amount}, balance is {balance}")

    super().__init__() က str(e) ရဲ့ message ကို သတ်မှတ်ပြီး self.balance နဲ့ self.amount က program က သုံးဖို့ value တွေကို သိမ်းထားပါတယ်။

  2. Guard the stateif amount <= 0:

    Method နှစ်ခုလုံးမှာ ဒီ check ပါလို့ deposit(-50) က ValueError ဖြစ်ပြီး balance က 1500 မှာပဲ ရှိနေပါတယ်။

  3. finally always reportsprint(f"Current balance: {acc.balance}")

    ဒီ line က finally ထဲမှာ ရှိလို့ withdraw() အောင်မြင်သည်ဖြစ်စေ၊ မအောင်မြင်သည်ဖြစ်စေ balance ကို ပြပါတယ်။

  4. with plus encodingwith open(path, encoding="utf-8") as f:

    with က readline() မှာ error ဖြစ်ရင်တောင် file ကို ပိတ်ပေးပြီး encoding က platform တိုင်းမှာ ဖတ်ပုံ တူအောင် လုပ်ပါတယ်။

  5. finally runs before the callerreturn f.readline().strip()

    Return value က caller ဆီ မရောက်ခင် finally က run ပါတယ်။ ဒါကြောင့် output မှာ "Read attempt finished" က "First line: Buy milk" ရဲ့ အပေါ်မှာ ပေါ်ပါတယ်။

  6. A stable sort by lengthby_length = dict(sorted(word_lengths.items(), key=lambda item: item[1]))

    fun နဲ့ and နှစ်ခုလုံး length 3 ဖြစ်ပေမယ့် sorted() က stable ဖြစ်လို့ list ထဲမှာ အရင်ပါတဲ့ fun က ရှေ့မှာ ကျန်ပါတယ်။

You should see
Error: cannot withdraw 2000, balance is 1500
Current balance: 1500
Error: amount must be positive, got -50
File not found: notes.txt - please check the name.
Read attempt finished
Read attempt finished
First line: Buy milk
{'is': 2, 'fun': 3, 'and': 3, 'python': 6, 'powerful': 8}

else နဲ့ finally ကို နှိုင်းယှဉ်ကြည့်ပါ

else block ကို သိပ်မသုံးကြပေမယ့် အသုံးဝင်ပါတယ်။ try ထဲမှာ exception ဖြစ်နိုင်တဲ့ line ကိုပဲ ထားပြီး အောင်မြင်မှ run ရမယ့် code ကို else ထဲ ရွှေ့ရင် except က မတော်တဆ မဆိုင်တဲ့ error တွေကို မဖမ်းမိတော့ပါဘူး။ အောက်က function ကို run ကြည့်ပြီး line တစ်ကြောင်းချင်း ဘယ်အချိန် ထွက်လဲ ကြည့်ပါ။

try_else_finally.py
def divide(a, b):
    try:
        result = a / b
    except ZeroDivisionError:
        print("cannot divide by zero")
        return None
    else:
        print("division ok")
        return result
    finally:
        print("finally runs either way")


print(divide(10, 4))
print(divide(1, 0))

လက်တွေ့ project တွေမှာ

လက်တွေ့ project တွေမှာ

Payment system တွေက InsufficientFundsError လို domain exception တွေကို service layer မှာ raise လုပ်ပြီး API layer က 4xx response အဖြစ် ပြောင်းပါတယ်။ ငွေကြေးကို float နဲ့ မသိမ်းဘဲ Decimal ဒါမှမဟုတ် integer cents နဲ့ သိမ်းပါတယ်၊ 0.1 + 0.2 က 0.30000000000000004 ဖြစ်လို့ပါ။ CSV import job တွေကလည်း မှားနေတဲ့ line တစ်ကြောင်းကြောင့် file တစ်ခုလုံးကို မငြင်းဘဲ line နံပါတ်ကို မှတ်ပြီး report ပြန်ပါတယ်။ Challenge ရဲ့ Inventory class က ဒီပုံစံကိုပဲ လိုက်ထားပါတယ်။

Team တွေက pytest ရဲ့ tmp_path fixture လို temporary folder တွေနဲ့ file code ကို test လုပ်ပါတယ်။ Challenge တစ်ခုစီအတွက် design note တိုတိုတစ်ခု၊ success နဲ့ failure test တွေ၊ cleanup ဖြစ်ကြောင်း အထောက်အထား ပါတဲ့ ရလဒ်ကို ပြင်ဆင်ကြည့်ပါ။ Code review မှာ ဒါတွေကို မေးလေ့ရှိပါတယ်။ ပြီးတော့ code မှန်ကန်ပြီး ဖတ်ရလွယ်ပြီဆိုမှ မြန်အောင် ပြင်ပါ၊ အစောကြီး optimize လုပ်တာက bug တွေကို ဖုံးကွယ်တတ်ပါတယ်။

အမှားများ

ဖြစ်လေ့ရှိတဲ့ အမှားများ

except: pass နဲ့ error ကို မျိုချတာ

Bare except ဒါမှမဟုတ် except Exception: pass က FileNotFoundError တင်မကဘဲ typo ကြောင့်ဖြစ်တဲ့ NameError ကိုပါ တိတ်တဆိတ် ဖျောက်ပါတယ်။ Program က ဆက် run ပေမယ့် ဘာကြောင့် data မရှိလဲ ဘယ်သူမှ မသိပါဘူး။

Class ထဲမှာ error ကို print လုပ်တာ

withdraw() က print လုပ်ပြီး return ပြန်ရင် ခေါ်တဲ့သူက အောင်မြင်လား မသိနိုင်ပါဘူး။ Web app ထဲမှာ ဒီ message က server log ထဲပဲ ရောက်ပြီး user ဆီ မရောက်ပါဘူး။ Raise လုပ်ပြီး caller က ဘယ်လိုပြမလဲ ဆုံးဖြတ်ပါစေ။

Amount အနှုတ်ကို မစစ်တာ

amount > self.balance check တစ်ခုတည်းနဲ့ withdraw(-50) က ငွေထည့်သွားပါတယ်။ Number တစ်ခုကို လက်ခံတဲ့ method တိုင်းမှာ 0 နဲ့ အနှုတ် case ကို စဉ်းစားပါ။

with နဲ့ encoding မပါဘဲ file ဖွင့်တာ

f = open(...) ပြီးနောက် error ဖြစ်ရင် file မပိတ်ဘဲ ကျန်ပြီး encoding မပေးရင် platform တစ်ခုမှာ အလုပ်လုပ်တဲ့ code က နောက်တစ်ခုမှာ UnicodeDecodeError ဖြစ်နိုင်ပါတယ်။

Best Practices

Best practices

  • Exception class နာမည်ကို Error နဲ့ အဆုံးသတ်ပြီး ဘာမှားလဲ ပြောတဲ့ နာမည် (InsufficientFundsError) ပေးပါ
  • try block ကို တိုနိုင်သမျှ တိုအောင် ထားပြီး fail ဖြစ်နိုင်တဲ့ line ကိုပဲ ထည့်ပါ
  • Error message ထဲမှာ ပြဿနာကို ပြင်ဖို့ လိုတဲ့ value တွေ (amount၊ balance၊ line နံပါတ်) ကို ထည့်ပါ
  • Task တစ်ခုစီအတွက် success test တစ်ခုနဲ့ failure test အနည်းဆုံး တစ်ခု ရေးပါ

Mini challenge

File ကနေ load လုပ်တဲ့ Inventory class

"name,qty" line တွေပါတဲ့ text file ကနေ stock ကို load လုပ်တဲ့ Inventory class ကို ရေးပါ။ မှားနေတဲ့ line တွေကို crash မဖြစ်ဘဲ မှတ်ထား၊ stock မလောက်ရင် custom exception raise လုပ်ပြီး stock နည်းတဲ့ item တွေကို dict comprehension နဲ့ ပြန်ပေးပါ။

  • load(path) က with နဲ့ encoding="utf-8" သုံးပြီး line အလွတ်တွေကို ကျော်ပါ
  • "oil,abc" ဒါမှမဟုတ် comma မပါတဲ့ line ရဲ့ နံပါတ်ကို bad_lines ထဲ ထည့်ပါ
  • remove(item, qty) က လက်ကျန်ထက် များရင် OutOfStockError raise လုပ်ပါ
  • low_stock(limit) က qty < limit ဖြစ်တဲ့ item တွေကို dict comprehension နဲ့ ပြန်ပေးပါ
  • Test file ကို tempfile.TemporaryDirectory() ထဲမှာ ဖန်တီးပါ
inventory.py
import os
import tempfile


class OutOfStockError(Exception):
    # TODO: accept item, wanted, available and build a helpful message
    ...


class Inventory:
    def __init__(self):
        # TODO: an empty stock dict and an empty bad_lines list
        ...

    def load(self, path):
        # TODO: enumerate the lines from 1; skip blanks;
        #       split on ",", convert qty with int(); record bad line numbers
        ...

    def remove(self, item, qty):
        # TODO: raise OutOfStockError if qty is more than what is left
        ...

    def low_stock(self, limit):
        # TODO: dict comprehension of items whose qty is below limit
        ...


# TODO: write a small stock file in a temporary folder, load it, try two removals

ရလဒ်: rice၊ tea၊ sugar သုံးခု load ဖြစ်ပြီး line 3 နဲ့ 6 က bad line အဖြစ် မှတ်ထားပါတယ်။ tea ကို ဒုတိယအကြိမ် 3 ခု ထုတ်ရင် "tea: wanted 3, only 2 left" error ရပြီး low stock မှာ tea နဲ့ sugar ပေါ်ပါတယ်။

အရိပ်အမြွက် ကြည့်ရန်

name, qty = line.split(",") က comma မပါရင် ဒါမှမဟုတ် နှစ်ခုထက်ပိုရင် ValueError raise လုပ်ပြီး int("abc") ကလည်း ValueError ပါပဲ။ ဒါကြောင့် except ValueError တစ်ခုတည်းက bad line နှစ်မျိုးလုံးကို ဖမ်းပါတယ်။ enumerate(f, start=1) က line နံပါတ်ကို 1 ကနေ စပေးပါတယ်။

အဖြေ ကြည့်ရန်
inventory.py
import os
import tempfile


class OutOfStockError(Exception):
    def __init__(self, item, wanted, available):
        super().__init__(f"{item}: wanted {wanted}, only {available} left")


class Inventory:
    def __init__(self):
        self.stock = {}
        self.bad_lines = []

    def load(self, path):
        with open(path, encoding="utf-8") as f:
            for number, line in enumerate(f, start=1):
                line = line.strip()
                if not line:
                    continue
                try:
                    name, qty = line.split(",")
                    self.stock[name.strip()] = int(qty)
                except ValueError:
                    self.bad_lines.append(number)

    def remove(self, item, qty):
        available = self.stock.get(item, 0)
        if qty > available:
            raise OutOfStockError(item, qty, available)
        self.stock[item] = available - qty

    def low_stock(self, limit):
        return {name: qty for name, qty in self.stock.items() if qty < limit}


with tempfile.TemporaryDirectory() as folder:
    path = os.path.join(folder, "stock.csv")
    with open(path, "w", encoding="utf-8") as f:
        f.write("rice,40\ntea,5\noil,abc\n\nsugar,12\nbroken line\n")
    inv = Inventory()
    inv.load(path)

print("stock:", inv.stock)
print("bad lines:", inv.bad_lines)
try:
    inv.remove("tea", 3)
    inv.remove("tea", 3)
except OutOfStockError as err:
    print("Error:", err)
print("low stock:", inv.low_stock(15))

Quick Quiz 1 / 3

Example ရဲ့ ဒုတိယ read_first_line() call (file ရှိပြီးနောက်) မှာ line နှစ်ကြောင်း ဘယ်အစီအစဉ်နဲ့ ထွက်လဲ။

Quick Quiz 2 / 3

acc = BankAccount(100); acc.withdraw(100); acc.withdraw(1) ဆိုရင် ဘာဖြစ်မလဲ။

Quick Quiz 3 / 3

Task 3 ရဲ့ output မှာ fun က and ရဲ့ ရှေ့မှာ ဘာကြောင့် ရှိနေတာလဲ (length 3 နှစ်ခုလုံး)။

မှတ်ထားရမယ့် အချက်များ

  • Class က method ထဲမှာ input ကို စစ်ပြီး ကိုယ့် state ကို စောင့်ရှောက်ပါ
  • Error ကို print မလုပ်ဘဲ data ပါတဲ့ custom exception အဖြစ် raise လုပ်ပါ
  • finally က return ရှိရင်တောင် အမြဲ run ပြီး file cleanup အတွက် with ကို သုံးပါ
  • File ကို encoding="utf-8" နဲ့ ဖွင့်ပြီး tempfile နဲ့ test လုပ်ပါ
  • sorted() က stable ဖြစ်လို့ key တူတဲ့ item တွေက မူလ အစီအစဉ်ကို ထိန်းထားပါတယ်

The Python Tutorial — Python Software Foundation

နောက်ဆုံးပြင်ဆင်ရက်

Progress ကို ဤ browser (ဤစက်) တွင်သာ သိမ်းထားပါသည်။ အခြားစက်များနှင့် sync မလုပ်ပါ။

ဤသင်ခန်းစာတွင် အမှားတွေ့ပါက အကြောင်းကြားရန်သင့် email app ကို ဤသင်ခန်းစာလိပ်စာ ဖြည့်ပြီးသားဖြင့် ဖွင့်ပေးပါမည် — သင်ကိုယ်တိုင် ပို့မှသာ ပို့မည်ဖြစ်သည်။

Exercise Set 2: Intermediate Practice (OOP, Files, Errors, Comprehensions) | Thuta Learning