[{"data":1,"prerenderedAt":364},["ShallowReactive",2],{"tag-labels":3,"site-header":4,"article-python-try-except-finally-id":75},{},{"featuredPost":5,"navigations":29},{"id":6,"title":7,"title_id":8,"slug":9,"excerpt":10,"excerpt_id":11,"has_translation":12,"published_at":13,"reading_time":14,"hidden_from_listing":15,"tags":16,"thumbnail_image":21,"og_image":22,"series":23,"authors":28},110,"When You Pick a Framework Just to Look Different","Ketika Pilih Framework Cuma Biar Kelihatan Beda","ketika-pilih-framework-cuma-biar-kelihatan-beda","The last time you chose a new framework or library, was it because your problem needed that tool, or because it sounded cool and few people around you were using it? That question is uncomfortable. Technology decisions are often made for reasons that never appear in any technical document.","Terakhir kali kamu milih framework atau library baru, itu karena masalahmu butuh alat itu, atau karena alatnya kedengaran keren dan belum banyak yang pakai? Pertanyaan ini nggak enak dijawab. Soalnya keputusan teknologi sering diambil dengan alasan yang nggak pernah ditulis di dokumen teknis mana pun.",true,"2026-10-06T15:25:21.000Z",5,false,[17,18,19,20],"karier","framework","opini","pengalaman",null,"\u002Fog\u002Fketika-pilih-framework-cuma-biar-kelihatan-beda.png",{"id":24,"title":25,"title_id":26,"slug":27},9,"Articles","Artikel","all",[],[30,49,70],{"collection":31,"item":32},"series",{"__typename":31,"title":25,"title_id":26,"slug":27,"children_series":33},[34,38,42,46],{"title":35,"title_id":36,"slug":37},"Artificial Intelligence","Kecerdasan Artifisial","kecerdasan-artifisial",{"title":39,"title_id":40,"slug":41},"Programming Fundamentals","Konsep Dasar Pemrograman","konsep-dasar-pemrograman",{"title":43,"title_id":44,"slug":45},"Algorithms and Data Structures","Algoritma dan Struktur Data","algoritma-struktur-data",{"title":47,"title_id":47,"slug":48},"LLM Systems","llm-systems",{"collection":31,"item":50},{"__typename":31,"title":51,"title_id":51,"slug":52,"children_series":53},"Tutorial","tutorial",[54,58,62,66],{"title":55,"title_id":56,"slug":57},"Learning Python","Belajar Python","belajar-python",{"title":59,"title_id":60,"slug":61},"Learning Go","Belajar Golang","belajar-golang",{"title":63,"title_id":64,"slug":65},"Learning Java","Belajar Java","belajar-java",{"title":67,"title_id":68,"slug":69},"Learning Pascal","Belajar Pascal","belajar-pascal",{"collection":31,"item":71},{"__typename":31,"title":72,"title_id":72,"slug":73,"children_series":74},"Lab","lab",[],{"article":76,"renderedBody":255,"renderedTakeaway":256,"latestArticles":257,"toc":350},{"id":77,"title":78,"title_id":78,"slug":79,"excerpt":80,"excerpt_id":80,"has_translation":12,"published_at":81,"reading_time":14,"hidden_from_listing":15,"tags":82,"thumbnail_image":21,"og_image":86,"series":87,"authors":247,"seoTitle":21,"seoDescription":21,"body_locale":250,"available_locales":251,"body":253,"takeway":254,"prerequisite":21},157,"Python try\u002Fexcept\u002Ffinally: Sel CSV Kosong yang Menghapus Total Laporan","python-try-except-finally","Total menit mati karena satu sel CSV kosong dan tidak mencetak apa pun, jadi baris yang berhasil dibaca ikut hilang bersamanya. Membungkus konversinya dengan `try` dan `except ValueError` melewati baris rusak itu, dan `finally` tetap mencetak ringkasan meski berkasnya tidak ada.","2026-11-16T01:00:00.000Z",[83,84,85],"python","error-handling","exception","\u002Fog\u002Fpython-try-except-finally.png",{"id":88,"title":89,"title_id":90,"slug":91,"description":92,"description_id":93,"articles":94,"children_series":216,"parent_series":217},18,"Working with Python Scripts","Menggunakan Script Python","python-pemrograman-dengan-script","Leave the interpreter and start writing real .py files, including how to take input and print output.","Keluar dari interpreter dan mulai nulis file .py sendiri, lengkap dengan cara mengambil input dan menampilkan output.",[95,116,132,148,164,179,194,201],{"id":96,"title":97,"title_id":98,"slug":99,"excerpt":100,"excerpt_id":101,"has_translation":12,"published_at":102,"reading_time":103,"hidden_from_listing":15,"tags":104,"thumbnail_image":21,"og_image":107,"series":108,"authors":109},90,"Writing and Running a Python Script","Menulis dan Menjalankan Script Python","menulis-dan-menjalankan-script-python","A Python script is a file holding Python code, and it usually carries the .py extension.","Script python merupakan file berisi kode dengan bahasa Python yang biasanya memiliki ekstensi .py","2021-03-21T14:49:24.000Z",4,[83,52,105,106],"tooling","cli","\u002Fog\u002Fmenulis-dan-menjalankan-script-python.png",{"id":88,"title":89,"title_id":90,"slug":91},[110],{"authors_id":111},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},1,"Daffa Izzuddin","izzudd","Writer",{"id":117,"title":118,"title_id":119,"slug":120,"excerpt":121,"excerpt_id":122,"has_translation":12,"published_at":123,"reading_time":103,"hidden_from_listing":15,"tags":124,"thumbnail_image":21,"og_image":127,"series":128,"authors":129},91,"Input and Output Systems in Python 3","Sistem Input dan Output pada Python 3","sistem-input-dan-output-pada-python-3","A few functions, print() and input() among them, are the standard tools most I\u002FO work in Python is built on.","Beberapa fungsi seperti print() dan input(), merupakan fungsi standar yang banyak digunakan untuk melakukan I\u002FO.","2021-05-19T14:57:25.000Z",[83,125,126],"input-output","dasar","\u002Fog\u002Fsistem-input-dan-output-pada-python-3.png",{"id":88,"title":89,"title_id":90,"slug":91},[130],{"authors_id":131},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":133,"title":134,"title_id":135,"slug":136,"excerpt":137,"excerpt_id":138,"has_translation":12,"published_at":139,"reading_time":140,"hidden_from_listing":15,"tags":141,"thumbnail_image":21,"og_image":143,"series":144,"authors":145},136,"Python Modules: the Import That Printed the Report","Modul Python: Import yang Mencetak Laporannya","python-modules","You pull one function out into its own file, import it, and the whole report runs again and eats your input. A module is a file, `import` runs it top to bottom, and one line decides which of the two jobs it is doing.","Kamu memindahkan satu fungsi ke file sendiri, meng-import-nya, dan seluruh laporan jalan lagi lalu memakan inputmu. Modul adalah file, `import` menjalankannya dari atas ke bawah, dan satu baris menentukan pekerjaan mana yang sedang dijalankan file itu.","2026-11-06T01:00:00.000Z",7,[83,142],"modules","\u002Fog\u002Fpython-modules.png",{"id":88,"title":89,"title_id":90,"slug":91},[146],{"authors_id":147},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":149,"title":150,"title_id":151,"slug":152,"excerpt":153,"excerpt_id":154,"has_translation":12,"published_at":155,"reading_time":14,"hidden_from_listing":15,"tags":156,"thumbnail_image":21,"og_image":159,"series":160,"authors":161},138,"Python venv: the Install That Went Into the Wrong Python","venv Python: Instalasi yang Masuk ke Python yang Salah","python-venv-pip","`pip install` printed Successfully installed, and the next run raised ModuleNotFoundError on the same machine. Two interpreters, one install, and the variable your script checks is the one the interpreter never sets.","`pip install` mencetak Successfully installed, lalu jalan berikutnya melempar ModuleNotFoundError di mesin yang sama. Dua interpreter, satu instalasi, dan variabel yang skripmu periksa justru tidak pernah dipasang oleh interpreter.","2026-11-07T12:00:00.000Z",[83,157,158],"venv","pip","\u002Fog\u002Fpython-venv-pip.png",{"id":88,"title":89,"title_id":90,"slug":91},[162],{"authors_id":163},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":165,"title":166,"title_id":167,"slug":168,"excerpt":169,"excerpt_id":170,"has_translation":12,"published_at":171,"reading_time":140,"hidden_from_listing":15,"tags":172,"thumbnail_image":21,"og_image":174,"series":175,"authors":176},143,"Python stdlib: the datetime json.dumps Refused to Write","Python stdlib: datetime yang Ditolak json.dumps","python-stdlib","A script that totals minutes per day dies on the line that writes the report. Four stdlib modules carry it, and one TypeError stands in the way.","Skrip yang menjumlahkan menit per hari mati tepat di baris yang menulis laporan. Empat modul stdlib membawanya, dan satu TypeError menghadang.","2026-11-08T01:00:00.000Z",[83,173,106],"stdlib","\u002Fog\u002Fpython-stdlib.png",{"id":88,"title":89,"title_id":90,"slug":91},[177],{"authors_id":178},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":180,"title":181,"title_id":182,"slug":183,"excerpt":184,"excerpt_id":185,"has_translation":12,"published_at":186,"reading_time":140,"hidden_from_listing":15,"tags":187,"thumbnail_image":21,"og_image":189,"series":190,"authors":191},144,"Python debugging: the script that exits 0 with the wrong total","Debugging Python: skrip keluar dengan kode 0, tapi totalnya salah","python-debugging","A totals script runs clean, prints a number, and the number is wrong. With no traceback to follow, you stop the program at the line that writes the value and read the dict from pdb.","Skrip penjumlah berjalan mulus, mencetak angka, dan angkanya salah. Tanpa traceback untuk diikuti, kamu menghentikan program di baris yang menulis nilai itu lalu membaca isi dict dari pdb.","2026-11-09T01:00:00.000Z",[83,188],"debugging","\u002Fog\u002Fpython-debugging.png",{"id":88,"title":89,"title_id":90,"slug":91},[192],{"authors_id":193},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":77,"title":195,"title_id":78,"slug":79,"excerpt":196,"excerpt_id":80,"has_translation":12,"published_at":81,"reading_time":14,"hidden_from_listing":15,"tags":82,"thumbnail_image":21,"og_image":86,"series":197,"authors":198},"Python try\u002Fexcept\u002Ffinally: Handling a Blank CSV Cell Without Losing the Total","A minutes total dies on one empty CSV cell and prints nothing, so the rows that parsed fine are lost with it. Wrapping the conversion in `try` with `except ValueError` skips the bad row, and `finally` prints the summary even when the file is missing.",{"id":88,"title":89,"title_id":90,"slug":91},[199],{"authors_id":200},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":202,"title":203,"title_id":204,"slug":205,"excerpt":206,"excerpt_id":207,"has_translation":12,"published_at":208,"reading_time":209,"hidden_from_listing":15,"tags":210,"thumbnail_image":21,"og_image":211,"series":212,"authors":213},162,"Python File I\u002FO: Why the Second Read Came Back Empty","Python File I\u002FO: Kenapa Pembacaan Kedua Kembali Kosong","python-file-read-write","A notes script saves a line, prints it back, then counts zero. The file on disk is correct: `read()` left the pointer at the end, so the second call returned an empty string. Read once into a variable, or `seek(0)`, and the count matches the file.","Skrip catatan menyimpan satu baris, mencetaknya kembali, lalu menghitung nol. Berkas di disk sudah benar: `read()` meninggalkan pointer di ujung, jadi panggilan kedua mengembalikan string kosong. Baca sekali ke sebuah variabel, atau `seek(0)`, dan hitungannya cocok dengan berkas.","2026-11-20T01:00:00.000Z",6,[83,125],"\u002Fog\u002Fpython-file-read-write.png",{"id":88,"title":89,"title_id":90,"slug":91},[214],{"authors_id":215},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},[],{"id":218,"title":55,"title_id":56,"slug":57,"parent_series":219,"children_series":220},10,{"id":112,"title":51,"title_id":51,"slug":52},[221,226,231,232,237,242],{"id":222,"title":223,"title_id":224,"slug":225,"cover_image":21},16,"Getting Started with Python","Berkenalan dengan Bahasa Python","python-intro",{"id":227,"title":228,"title_id":229,"slug":230,"cover_image":21},17,"Variables, Types, and Operations","Variabel, Tipe Data, dan Operasi","python-variabel-tipe-data",{"id":88,"title":89,"title_id":90,"slug":91,"cover_image":21},{"id":233,"title":234,"title_id":235,"slug":236,"cover_image":21},19,"Control Structures","Struktur Kontrol","python-struktur-kontrol",{"id":238,"title":239,"title_id":240,"slug":241,"cover_image":21},20,"Functional Programming with Python","Pemrograman Fungsional dengan Python","python-pemrograman-fungsional",{"id":243,"title":244,"title_id":245,"slug":246,"cover_image":21},30,"Collections and Strings","Koleksi dan String","python-collections",[248],{"authors_id":249},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},"id",[252,250],"en","\nSebuah skrip pendek menjumlahkan menit di dalam berkas CSV dan mencetak satu baris berisi total. Lalu satu sel kosong. Skripnya mati dengan traceback dan tidak mencetak apa pun, jadi baris yang sudah terbaca benar ikut lenyap bersamanya. Kamu kehilangan seluruh laporan gara-gara satu kolom kosong.\n\n## Ketika skripnya mati\n\nSimpan ini sebagai `sessions.csv`. Baris untuk 2026-11-04 punya kolom `minutes` yang kosong.\n\n```csv\ndate,minutes\n2026-11-03,20\n2026-11-04,\n2026-11-05,30\n```\n\nSimpan skrip awalnya sebagai `totals.py`. Skrip ini mengambil path berkas dari baris perintah dan menjumlahkan kolom `minutes`. `csv.DictReader` memberimu satu dict per baris dengan nilai berupa string, jadi skripnya mengonversi tiap nilai dengan `int`.\n\n```python\n# totals.py\nimport csv\nimport sys\n\npath = sys.argv[1]\n\ntotal = 0\nwith open(path, newline=\"\") as handle:\n    for row in csv.DictReader(handle):\n        total += int(row[\"minutes\"])\n\nprint(f\"total {total}\")\n```\n\nMenjalankannya pada berkas itu berakhir dengan traceback dan status keluar 1.\n\n```text\n$ python3 totals.py sessions.csv 2>&1 | tail -2\n    total += int(row[\"minutes\"])\nValueError: invalid literal for int() with base 10: ''\n```\n\nBaris terakhir menyebut masalahnya. `int(\"\")` tidak punya apa pun untuk dikonversi, jadi ia melempar `ValueError`. Tidak ada yang tercetak sebelum traceback, jadi dua baris yang sehat juga tidak mencetak apa pun.\n\nChecker `check_totals.py` mengubah kegagalan ini menjadi angka. Ia menulis `sessions.csv` sendiri, menjalankan `totals.py` di proses anak, dan menghitung pemeriksaan yang lolos.\n\n```python\n# check_totals.py\nimport subprocess\nimport sys\nfrom pathlib import Path\n\nROWS = \"\"\"date,minutes\n2026-11-03,20\n2026-11-04,\n2026-11-05,30\n\"\"\"\n\n\ndef run(path):\n    return subprocess.run([sys.executable, \"totals.py\", path], text=True, capture_output=True)\n\n\ndef report(results):\n    for label, passed, detail in results:\n        mark = \"PASS\" if passed else \"FAIL\"\n        note = f\"  \u003C- {detail}\" if detail and not passed else \"\"\n        print(f\"{mark}  {label}{note}\")\n    passed = [ok for _, ok, _ in results].count(True)\n    print(f\"\\n{passed} of {len(results)} checks passed\")\n\n\ndef main():\n    path = Path(\"sessions.csv\")\n    path.write_text(ROWS)\n\n    run_ok = run(str(path))\n    crashed = run_ok.returncode != 0\n    last = run_ok.stderr.strip().splitlines()[-1] if run_ok.stderr.strip() else \"\"\n\n    results = [(\"the script finishes on a file with one blank field\", not crashed, last)]\n    if crashed:\n        report(results)\n        return 1\n\n    out = run_ok.stdout\n    lines = [line for line in out.splitlines() if line.strip()]\n\n    results.append((\"it prints the total of the rows it could read\", \"total 50\" in out, out.strip()))\n    results.append((\"it says which row it skipped\", \"2026-11-04\" in out, out.strip()))\n    results.append((\"it prints one line per skipped row\", len(lines) == 2, str(lines)))\n\n    run_missing = run(\"no_such_file.csv\")\n    results.append((\"it still reports the summary when the file is missing\", \"read 0 rows\" in run_missing.stdout, run_missing.stdout.strip()))\n    results.append((\"the missing file still raises\", run_missing.returncode != 0, f\"exit {run_missing.returncode}\"))\n\n    report(results)\n    return 0 if all(ok for _, ok, _ in results) else 1\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n```\n\nTerhadap versi awal, checker mencetak nol dan keluar dengan status 1.\n\n```text\n$ python3 check_totals.py\nFAIL  the script finishes on a file with one blank field  \u003C- ValueError: invalid literal for int() with base 10: ''\n\n0 of 1 checks passed\n```\n\n## Perbaikan seminimal mungkin\n\nBungkus hanya konversinya dengan `try`. Saat `int` melempar, Python melompat ke `except` yang cocok dan melewati sisa blok `try`. Baris yang dilewati menambah satu ke penghitung dan mencetak tanggalnya, lalu loop lanjut ke baris berikutnya.\n\n`!r` di f-string mencetak repr dari nilainya, jadi string kosong muncul sebagai `''` alih-alih menghilang. `finally` di bagian bawah mencetak baris ringkasan.\n\n```python\n# totals.py\nimport csv\nimport sys\n\npath = sys.argv[1]\n\ntotal = 0\nread = 0\nskipped = 0\ntry:\n    with open(path, newline=\"\") as handle:\n        for row in csv.DictReader(handle):\n            read += 1\n            try:\n                total += int(row[\"minutes\"])\n            except ValueError:\n                skipped += 1\n                print(f\"skipped {row['date']}: {row['minutes']!r}\")\nfinally:\n    print(f\"read {read} rows, skipped {skipped}, total {total}\")\n```\n\nJalannya sekarang selesai dengan status keluar 0. Ketiga baris terhitung terbaca, yang kosong dilewati, dan totalnya 50.\n\n```text\n$ python3 totals.py sessions.csv\nskipped 2026-11-04: ''\nread 3 rows, skipped 1, total 50\n```\n\nError lain tetap sampai ke kamu, karena `except ValueError` hanya menangkap `ValueError` dan turunannya.\n\n## Kenapa `finally`\n\nArahkan skrip yang sudah diperbaiki ke berkas yang tidak ada.\n\n```text\n$ python3 totals.py no_such_file.csv 2>&1 | sed -n '1p;$p'\nread 0 rows, skipped 0, total 0\nFileNotFoundError: [Errno 2] No such file or directory: 'no_such_file.csv'\n```\n\nBaris ringkasannya tercetak, dan errornya masih ada di akhir. Blok `finally` berjalan entah bloknya berhasil, melempar, atau return. Berbeda dari `except`, ia tidak menangkap exception; ia menjalankan pembersihannya lalu membiarkan errornya merambat.\n\nChecker mencakup kedua jalannya, kolom kosong dan berkas yang hilang, dan keenam pemeriksaan lolos dengan status keluar 0.\n\n```text\n$ python3 check_totals.py\nPASS  the script finishes on a file with one blank field\nPASS  it prints the total of the rows it could read\nPASS  it says which row it skipped\nPASS  it prints one line per skipped row\nPASS  it still reports the summary when the file is missing\nPASS  the missing file still raises\n\n6 of 6 checks passed\n```\n\n## Jebakannya\n\n`except:` tanpa nama sama dengan `except BaseException:`, jadi ia menangkap lebih dari sekadar error. Berkas yang memanggil `sys.exit(3)` di dalam `try` dengan `except:` tanpa nama mencetak `swallowed` dan keluar dengan status 0. Berkas yang melempar `KeyboardInterrupt` di dalam `try` dengan `except:` tanpa nama mencetak `bare except swallowed it` dan keluar dengan status 0. Keluar yang disengaja dan Ctrl-C sama-sama berubah jadi jalan yang sukses.\n\nSekarang rusak salinanmu sendiri. Hapus baris `finally:` dari `totals.py` dan kurangi indentasi `print` ringkasannya. Checker melaporkan `5 of 6 checks passed` dan keluar dengan status 1, karena jalan untuk berkas yang hilang jadi tidak mencetak ringkasan sama sekali.\n","- Satu sel kosong melempar `ValueError` dan menghentikan jalan sebelum totalnya tercetak, jadi baris yang sudah terbaca benar ikut hilang.\n- `try` di sekitar satu konversi itu dan `except ValueError` melewati baris tersebut, menghitungnya, dan membiarkan loop sampai ke ujung.\n- `finally` berjalan entah bloknya berhasil atau melempar, itulah sebabnya baris ringkasan tercetak sebelum error berkas yang hilang.\n- `except:` tanpa nama juga menelan `sys.exit()` dan Ctrl-C, jadi sebutkan exception yang kamu harapkan.","\u003Cp>Sebuah skrip pendek menjumlahkan menit di dalam berkas CSV dan mencetak satu baris berisi total. Lalu satu sel kosong. Skripnya mati dengan traceback dan tidak mencetak apa pun, jadi baris yang sudah terbaca benar ikut lenyap bersamanya. Kamu kehilangan seluruh laporan gara-gara satu kolom kosong.\u003C\u002Fp>\n\u003Ch2 id=\"ketika-skripnya-mati\">Ketika skripnya mati\u003C\u002Fh2>\n\u003Cp>Simpan ini sebagai \u003Ccode>sessions.csv\u003C\u002Fcode>. Baris untuk 2026-11-04 punya kolom \u003Ccode>minutes\u003C\u002Fcode> yang kosong.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">CSV\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"date%2Cminutes%0A2026-11-03%2C20%0A2026-11-04%2C%0A2026-11-05%2C30\" title=\"Salin\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Salin\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>date,minutes\n2026-11-03,20\n2026-11-04,\n2026-11-05,30\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Simpan skrip awalnya sebagai \u003Ccode>totals.py\u003C\u002Fcode>. Skrip ini mengambil path berkas dari baris perintah dan menjumlahkan kolom \u003Ccode>minutes\u003C\u002Fcode>. \u003Ccode>csv.DictReader\u003C\u002Fcode> memberimu satu dict per baris dengan nilai berupa string, jadi skripnya mengonversi tiap nilai dengan \u003Ccode>int\u003C\u002Fcode>.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PYTHON\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%23%20totals.py%0Aimport%20csv%0Aimport%20sys%0A%0Apath%20%3D%20sys.argv%5B1%5D%0A%0Atotal%20%3D%200%0Awith%20open(path%2C%20newline%3D%22%22)%20as%20handle%3A%0A%20%20%20%20for%20row%20in%20csv.DictReader(handle)%3A%0A%20%20%20%20%20%20%20%20total%20%2B%3D%20int(row%5B%22minutes%22%5D)%0A%0Aprint(f%22total%20%7Btotal%7D%22)\" title=\"Salin\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Salin\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#6A737D\"># totals.py\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> csv\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> sys\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">path \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> sys.argv[\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">1\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">]\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">total \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 0\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">with\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> open\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(path, \u003C\u002Fspan>\u003Cspan style=\"color:#FFAB70\">newline\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">) \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">as\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> handle:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    for\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> row \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> csv.DictReader(handle):\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">        total \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">+=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> int\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(row[\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"minutes\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">])\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79B8FF\">print\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">f\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"total \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">total\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Menjalankannya pada berkas itu berakhir dengan traceback dan status keluar 1.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">TEXT\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20python3%20totals.py%20sessions.csv%202%3E%261%20%7C%20tail%20-2%0A%20%20%20%20total%20%2B%3D%20int(row%5B%22minutes%22%5D)%0AValueError%3A%20invalid%20literal%20for%20int()%20with%20base%2010%3A%20''\" title=\"Salin\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Salin\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>$ python3 totals.py sessions.csv 2&gt;&amp;1 | tail -2\n    total += int(row[\"minutes\"])\nValueError: invalid literal for int() with base 10: ''\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Baris terakhir menyebut masalahnya. \u003Ccode>int(&quot;&quot;)\u003C\u002Fcode> tidak punya apa pun untuk dikonversi, jadi ia melempar \u003Ccode>ValueError\u003C\u002Fcode>. Tidak ada yang tercetak sebelum traceback, jadi dua baris yang sehat juga tidak mencetak apa pun.\u003C\u002Fp>\n\u003Cp>Checker \u003Ccode>check_totals.py\u003C\u002Fcode> mengubah kegagalan ini menjadi angka. Ia menulis \u003Ccode>sessions.csv\u003C\u002Fcode> sendiri, menjalankan \u003Ccode>totals.py\u003C\u002Fcode> di proses anak, dan menghitung pemeriksaan yang lolos.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PYTHON\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%23%20check_totals.py%0Aimport%20subprocess%0Aimport%20sys%0Afrom%20pathlib%20import%20Path%0A%0AROWS%20%3D%20%22%22%22date%2Cminutes%0A2026-11-03%2C20%0A2026-11-04%2C%0A2026-11-05%2C30%0A%22%22%22%0A%0A%0Adef%20run(path)%3A%0A%20%20%20%20return%20subprocess.run(%5Bsys.executable%2C%20%22totals.py%22%2C%20path%5D%2C%20text%3DTrue%2C%20capture_output%3DTrue)%0A%0A%0Adef%20report(results)%3A%0A%20%20%20%20for%20label%2C%20passed%2C%20detail%20in%20results%3A%0A%20%20%20%20%20%20%20%20mark%20%3D%20%22PASS%22%20if%20passed%20else%20%22FAIL%22%0A%20%20%20%20%20%20%20%20note%20%3D%20f%22%20%20%3C-%20%7Bdetail%7D%22%20if%20detail%20and%20not%20passed%20else%20%22%22%0A%20%20%20%20%20%20%20%20print(f%22%7Bmark%7D%20%20%7Blabel%7D%7Bnote%7D%22)%0A%20%20%20%20passed%20%3D%20%5Bok%20for%20_%2C%20ok%2C%20_%20in%20results%5D.count(True)%0A%20%20%20%20print(f%22%5Cn%7Bpassed%7D%20of%20%7Blen(results)%7D%20checks%20passed%22)%0A%0A%0Adef%20main()%3A%0A%20%20%20%20path%20%3D%20Path(%22sessions.csv%22)%0A%20%20%20%20path.write_text(ROWS)%0A%0A%20%20%20%20run_ok%20%3D%20run(str(path))%0A%20%20%20%20crashed%20%3D%20run_ok.returncode%20!%3D%200%0A%20%20%20%20last%20%3D%20run_ok.stderr.strip().splitlines()%5B-1%5D%20if%20run_ok.stderr.strip()%20else%20%22%22%0A%0A%20%20%20%20results%20%3D%20%5B(%22the%20script%20finishes%20on%20a%20file%20with%20one%20blank%20field%22%2C%20not%20crashed%2C%20last)%5D%0A%20%20%20%20if%20crashed%3A%0A%20%20%20%20%20%20%20%20report(results)%0A%20%20%20%20%20%20%20%20return%201%0A%0A%20%20%20%20out%20%3D%20run_ok.stdout%0A%20%20%20%20lines%20%3D%20%5Bline%20for%20line%20in%20out.splitlines()%20if%20line.strip()%5D%0A%0A%20%20%20%20results.append((%22it%20prints%20the%20total%20of%20the%20rows%20it%20could%20read%22%2C%20%22total%2050%22%20in%20out%2C%20out.strip()))%0A%20%20%20%20results.append((%22it%20says%20which%20row%20it%20skipped%22%2C%20%222026-11-04%22%20in%20out%2C%20out.strip()))%0A%20%20%20%20results.append((%22it%20prints%20one%20line%20per%20skipped%20row%22%2C%20len(lines)%20%3D%3D%202%2C%20str(lines)))%0A%0A%20%20%20%20run_missing%20%3D%20run(%22no_such_file.csv%22)%0A%20%20%20%20results.append((%22it%20still%20reports%20the%20summary%20when%20the%20file%20is%20missing%22%2C%20%22read%200%20rows%22%20in%20run_missing.stdout%2C%20run_missing.stdout.strip()))%0A%20%20%20%20results.append((%22the%20missing%20file%20still%20raises%22%2C%20run_missing.returncode%20!%3D%200%2C%20f%22exit%20%7Brun_missing.returncode%7D%22))%0A%0A%20%20%20%20report(results)%0A%20%20%20%20return%200%20if%20all(ok%20for%20_%2C%20ok%2C%20_%20in%20results)%20else%201%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20sys.exit(main())\" title=\"Salin\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Salin\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#6A737D\"># check_totals.py\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> subprocess\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> sys\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">from\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> pathlib \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> Path\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79B8FF\">ROWS\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> =\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\"> \"\"\"date,minutes\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#9ECBFF\">2026-11-03,20\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#9ECBFF\">2026-11-04,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#9ECBFF\">2026-11-05,30\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#9ECBFF\">\"\"\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">def\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\"> run\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(path):\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    return\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> subprocess.run([sys.executable, \u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"totals.py\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, path], \u003C\u002Fspan>\u003Cspan style=\"color:#FFAB70\">text\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">True\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, \u003C\u002Fspan>\u003Cspan style=\"color:#FFAB70\">capture_output\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">True\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">def\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\"> report\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(results):\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    for\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> label, passed, detail \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> results:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">        mark \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\"> \"PASS\"\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> if\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> passed \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">else\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\"> \"FAIL\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">        note \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> f\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"  &#x3C;- \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">detail\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> if\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> detail \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">and\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> not\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> passed \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">else\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\"> \"\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79B8FF\">        print\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">f\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">mark\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">  {\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">label\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">note\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    passed \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> [ok \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">for\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> _, ok, _ \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> results].count(\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">True\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79B8FF\">    print\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">f\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">\\n{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">passed\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\"> of \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{len\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(results)\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\"> checks passed\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">def\u003C\u002Fspan>\u003Cspan style=\"color:#B392F0\"> main\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">():\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    path \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> Path(\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"sessions.csv\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    path.write_text(\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">ROWS\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    run_ok \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> run(\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">str\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(path))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    crashed \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> run_ok.returncode \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">!=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 0\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    last \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> run_ok.stderr.strip().splitlines()[\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">-\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">1\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">] \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">if\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> run_ok.stderr.strip() \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">else\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\"> \"\"\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    results \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> [(\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"the script finishes on a file with one blank field\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">not\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> crashed, last)]\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    if\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> crashed:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">        report(results)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">        return\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 1\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    out \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> run_ok.stdout\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    lines \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> [line \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">for\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> line \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> out.splitlines() \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">if\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> line.strip()]\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    results.append((\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"it prints the total of the rows it could read\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, \u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"total 50\"\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> out, out.strip()))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    results.append((\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"it says which row it skipped\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, \u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"2026-11-04\"\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> out, out.strip()))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    results.append((\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"it prints one line per skipped row\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">len\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(lines) \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">==\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 2\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">str\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(lines)))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    run_missing \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> run(\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"no_such_file.csv\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    results.append((\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"it still reports the summary when the file is missing\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, \u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"read 0 rows\"\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> run_missing.stdout, run_missing.stdout.strip()))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    results.append((\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"the missing file still raises\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, run_missing.returncode \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">!=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 0\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">, \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">f\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"exit \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">run_missing.returncode\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">))\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    report(results)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    return\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 0\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> if\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> all\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(ok \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">for\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> _, ok, _ \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> results) \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">else\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 1\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">if\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> __name__\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\"> ==\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\"> \"__main__\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">    sys.exit(main())\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Terhadap versi awal, checker mencetak nol dan keluar dengan status 1.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">TEXT\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20python3%20check_totals.py%0AFAIL%20%20the%20script%20finishes%20on%20a%20file%20with%20one%20blank%20field%20%20%3C-%20ValueError%3A%20invalid%20literal%20for%20int()%20with%20base%2010%3A%20''%0A%0A0%20of%201%20checks%20passed\" title=\"Salin\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Salin\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>$ python3 check_totals.py\nFAIL  the script finishes on a file with one blank field  &lt;- ValueError: invalid literal for int() with base 10: ''\n\n0 of 1 checks passed\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Ch2 id=\"perbaikan-seminimal-mungkin\">Perbaikan seminimal mungkin\u003C\u002Fh2>\n\u003Cp>Bungkus hanya konversinya dengan \u003Ccode>try\u003C\u002Fcode>. Saat \u003Ccode>int\u003C\u002Fcode> melempar, Python melompat ke \u003Ccode>except\u003C\u002Fcode> yang cocok dan melewati sisa blok \u003Ccode>try\u003C\u002Fcode>. Baris yang dilewati menambah satu ke penghitung dan mencetak tanggalnya, lalu loop lanjut ke baris berikutnya.\u003C\u002Fp>\n\u003Cp>\u003Ccode>!r\u003C\u002Fcode> di f-string mencetak repr dari nilainya, jadi string kosong muncul sebagai \u003Ccode>&#39;&#39;\u003C\u002Fcode> alih-alih menghilang. \u003Ccode>finally\u003C\u002Fcode> di bagian bawah mencetak baris ringkasan.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PYTHON\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%23%20totals.py%0Aimport%20csv%0Aimport%20sys%0A%0Apath%20%3D%20sys.argv%5B1%5D%0A%0Atotal%20%3D%200%0Aread%20%3D%200%0Askipped%20%3D%200%0Atry%3A%0A%20%20%20%20with%20open(path%2C%20newline%3D%22%22)%20as%20handle%3A%0A%20%20%20%20%20%20%20%20for%20row%20in%20csv.DictReader(handle)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20read%20%2B%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20total%20%2B%3D%20int(row%5B%22minutes%22%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20except%20ValueError%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20skipped%20%2B%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(f%22skipped%20%7Brow%5B'date'%5D%7D%3A%20%7Brow%5B'minutes'%5D!r%7D%22)%0Afinally%3A%0A%20%20%20%20print(f%22read%20%7Bread%7D%20rows%2C%20skipped%20%7Bskipped%7D%2C%20total%20%7Btotal%7D%22)\" title=\"Salin\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Salin\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"color:#6A737D\"># totals.py\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> csv\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">import\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> sys\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">path \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> sys.argv[\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">1\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">]\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">total \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 0\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">read \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 0\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">skipped \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 0\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">try\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">    with\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> open\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(path, \u003C\u002Fspan>\u003Cspan style=\"color:#FFAB70\">newline\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">=\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">) \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">as\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> handle:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">        for\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> row \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">in\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\"> csv.DictReader(handle):\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">            read \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">+=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 1\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">            try\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">                total \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">+=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> int\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(row[\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"minutes\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">])\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">            except\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> ValueError\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#E1E4E8\">                skipped \u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">+=\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\"> 1\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79B8FF\">                print\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">f\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"skipped \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">row[\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">'date'\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">]\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">: \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">row[\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">'minutes'\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">]\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">!r\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#F97583\">finally\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"color:#79B8FF\">    print\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">(\u003C\u002Fspan>\u003Cspan style=\"color:#F97583\">f\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"read \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">read\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\"> rows, skipped \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">skipped\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">, total \u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">{\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">total\u003C\u002Fspan>\u003Cspan style=\"color:#79B8FF\">}\u003C\u002Fspan>\u003Cspan style=\"color:#9ECBFF\">\"\u003C\u002Fspan>\u003Cspan style=\"color:#E1E4E8\">)\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Jalannya sekarang selesai dengan status keluar 0. Ketiga baris terhitung terbaca, yang kosong dilewati, dan totalnya 50.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">TEXT\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20python3%20totals.py%20sessions.csv%0Askipped%202026-11-04%3A%20''%0Aread%203%20rows%2C%20skipped%201%2C%20total%2050\" title=\"Salin\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Salin\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>$ python3 totals.py sessions.csv\nskipped 2026-11-04: ''\nread 3 rows, skipped 1, total 50\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Error lain tetap sampai ke kamu, karena \u003Ccode>except ValueError\u003C\u002Fcode> hanya menangkap \u003Ccode>ValueError\u003C\u002Fcode> dan turunannya.\u003C\u002Fp>\n\u003Ch2 id=\"kenapa-finally\">Kenapa \u003Ccode>finally\u003C\u002Fcode>\u003C\u002Fh2>\n\u003Cp>Arahkan skrip yang sudah diperbaiki ke berkas yang tidak ada.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">TEXT\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20python3%20totals.py%20no_such_file.csv%202%3E%261%20%7C%20sed%20-n%20'1p%3B%24p'%0Aread%200%20rows%2C%20skipped%200%2C%20total%200%0AFileNotFoundError%3A%20%5BErrno%202%5D%20No%20such%20file%20or%20directory%3A%20'no_such_file.csv'\" title=\"Salin\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Salin\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>$ python3 totals.py no_such_file.csv 2&gt;&amp;1 | sed -n '1p;$p'\nread 0 rows, skipped 0, total 0\nFileNotFoundError: [Errno 2] No such file or directory: 'no_such_file.csv'\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Baris ringkasannya tercetak, dan errornya masih ada di akhir. Blok \u003Ccode>finally\u003C\u002Fcode> berjalan entah bloknya berhasil, melempar, atau return. Berbeda dari \u003Ccode>except\u003C\u002Fcode>, ia tidak menangkap exception; ia menjalankan pembersihannya lalu membiarkan errornya merambat.\u003C\u002Fp>\n\u003Cp>Checker mencakup kedua jalannya, kolom kosong dan berkas yang hilang, dan keenam pemeriksaan lolos dengan status keluar 0.\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">TEXT\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20python3%20check_totals.py%0APASS%20%20the%20script%20finishes%20on%20a%20file%20with%20one%20blank%20field%0APASS%20%20it%20prints%20the%20total%20of%20the%20rows%20it%20could%20read%0APASS%20%20it%20says%20which%20row%20it%20skipped%0APASS%20%20it%20prints%20one%20line%20per%20skipped%20row%0APASS%20%20it%20still%20reports%20the%20summary%20when%20the%20file%20is%20missing%0APASS%20%20the%20missing%20file%20still%20raises%0A%0A6%20of%206%20checks%20passed\" title=\"Salin\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Salin\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>$ python3 check_totals.py\nPASS  the script finishes on a file with one blank field\nPASS  it prints the total of the rows it could read\nPASS  it says which row it skipped\nPASS  it prints one line per skipped row\nPASS  it still reports the summary when the file is missing\nPASS  the missing file still raises\n\n6 of 6 checks passed\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Ch2 id=\"jebakannya\">Jebakannya\u003C\u002Fh2>\n\u003Cp>\u003Ccode>except:\u003C\u002Fcode> tanpa nama sama dengan \u003Ccode>except BaseException:\u003C\u002Fcode>, jadi ia menangkap lebih dari sekadar error. Berkas yang memanggil \u003Ccode>sys.exit(3)\u003C\u002Fcode> di dalam \u003Ccode>try\u003C\u002Fcode> dengan \u003Ccode>except:\u003C\u002Fcode> tanpa nama mencetak \u003Ccode>swallowed\u003C\u002Fcode> dan keluar dengan status 0. Berkas yang melempar \u003Ccode>KeyboardInterrupt\u003C\u002Fcode> di dalam \u003Ccode>try\u003C\u002Fcode> dengan \u003Ccode>except:\u003C\u002Fcode> tanpa nama mencetak \u003Ccode>bare except swallowed it\u003C\u002Fcode> dan keluar dengan status 0. Keluar yang disengaja dan Ctrl-C sama-sama berubah jadi jalan yang sukses.\u003C\u002Fp>\n\u003Cp>Sekarang rusak salinanmu sendiri. Hapus baris \u003Ccode>finally:\u003C\u002Fcode> dari \u003Ccode>totals.py\u003C\u002Fcode> dan kurangi indentasi \u003Ccode>print\u003C\u002Fcode> ringkasannya. Checker melaporkan \u003Ccode>5 of 6 checks passed\u003C\u002Fcode> dan keluar dengan status 1, karena jalan untuk berkas yang hilang jadi tidak mencetak ringkasan sama sekali.\u003C\u002Fp>\n","\u003Cul>\n\u003Cli>Satu sel kosong melempar \u003Ccode>ValueError\u003C\u002Fcode> dan menghentikan jalan sebelum totalnya tercetak, jadi baris yang sudah terbaca benar ikut hilang.\u003C\u002Fli>\n\u003Cli>\u003Ccode>try\u003C\u002Fcode> di sekitar satu konversi itu dan \u003Ccode>except ValueError\u003C\u002Fcode> melewati baris tersebut, menghitungnya, dan membiarkan loop sampai ke ujung.\u003C\u002Fli>\n\u003Cli>\u003Ccode>finally\u003C\u002Fcode> berjalan entah bloknya berhasil atau melempar, itulah sebabnya baris ringkasan tercetak sebelum error berkas yang hilang.\u003C\u002Fli>\n\u003Cli>\u003Ccode>except:\u003C\u002Fcode> tanpa nama juga menelan \u003Ccode>sys.exit()\u003C\u002Fcode> dan Ctrl-C, jadi sebutkan exception yang kamu harapkan.\u003C\u002Fli>\n\u003C\u002Ful>\n",[258,273,294,312,317,336],{"id":259,"title":260,"title_id":261,"slug":262,"excerpt":263,"excerpt_id":264,"has_translation":12,"published_at":265,"reading_time":266,"hidden_from_listing":15,"tags":267,"thumbnail_image":21,"og_image":268,"series":269,"authors":270},164,"Python Capstone: Why a Blank CSV Field Cut the Class Average","Python Capstone: Kenapa Satu Kolom CSV Kosong Memotong Rata-rata Kelas","python-capstone-gradebook","A gradebook reads four students and writes a JSON report. The class average says 52.42, because two empty fields became zeros.","Buku nilai membaca empat siswa dan menulis laporan JSON. Rata-rata kelasnya bilang 52.42, karena dua kolom kosong berubah jadi nol.","2026-11-21T01:00:00.000Z",8,[83,125,106],"\u002Fog\u002Fpython-capstone-gradebook.png",{"id":218,"title":55,"title_id":56,"slug":57},[271],{"authors_id":272},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":274,"title":275,"title_id":276,"slug":277,"excerpt":278,"excerpt_id":279,"has_translation":12,"published_at":265,"reading_time":103,"hidden_from_listing":15,"tags":280,"thumbnail_image":21,"og_image":285,"series":286,"authors":291},48,"What a Linked List Actually Is","Tentang Struktur Data LinkedList","tentang-struktur-data-linked-list","A linked list is a linear chain of nodes, each holding data and a pointer to the next node. Here is what that chain looks like, what it costs next to an array, and the same minimal implementation in Java, Python, and JavaScript.","Linked list adalah rantai linear berisi node, dan setiap node menyimpan data plus pointer ke node berikutnya. Ini bentuk rantainya, ongkosnya dibanding array, dan implementasi paling sederhana dalam Java, Python, serta JavaScript.",[281,282,283,284],"struktur-data","linked-list","pointer","konsep","\u002Fog\u002Ftentang-struktur-data-linked-list.png",{"id":287,"title":288,"title_id":289,"slug":290},28,"Linear Data Structures","Struktur Data Linear","asd-struktur-linear",[292],{"authors_id":293},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":295,"title":296,"title_id":297,"slug":298,"excerpt":299,"excerpt_id":300,"has_translation":12,"published_at":208,"reading_time":209,"hidden_from_listing":15,"tags":301,"thumbnail_image":21,"og_image":306,"series":307,"authors":309},163,"Pascal Capstone: Why Every Gradebook Score Came Back Zero","Capstone Pascal: Kenapa Semua Skor Buku Nilai Kembali Nol","pascal-gradebook-capstone","A gradebook reads three students from a file, prints three rows, and every score is 0. The procedure filled a copy of the array, because the parameter was missing `var`. Add the word and the report matches the file; the compiler had already warned about the call that filled nothing.","Sebuah buku nilai membaca tiga siswa dari berkas, mencetak tiga baris, dan setiap skornya 0. Prosedurnya mengisi salinan array, karena parameternya kehilangan `var`. Tambahkan kata itu dan laporannya cocok dengan berkasnya; kompilator sudah memperingatkan soal pemanggilan yang tidak mengisi apa pun.",[302,303,304,305],"pascal","record","array","prosedur","\u002Fog\u002Fpascal-gradebook-capstone.png",{"id":308,"title":67,"title_id":68,"slug":69},14,[310],{"authors_id":311},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":202,"title":203,"title_id":204,"slug":205,"excerpt":206,"excerpt_id":207,"has_translation":12,"published_at":208,"reading_time":209,"hidden_from_listing":15,"tags":210,"thumbnail_image":21,"og_image":211,"series":313,"authors":314},{"id":88,"title":89,"title_id":90,"slug":91},[315],{"authors_id":316},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":318,"title":319,"title_id":320,"slug":321,"excerpt":322,"excerpt_id":323,"has_translation":12,"published_at":324,"reading_time":140,"hidden_from_listing":15,"tags":325,"thumbnail_image":21,"og_image":327,"series":328,"authors":333},47,"Why Understanding Algorithms and Data Structures Actually Matters","Pentingnya Memahami Algoritma dan Struktur Data","pentingnya-memahami-algoritma-dan-struktur-data","An algorithm is an ordered list of steps, and that order decides how expensive a problem is. The examples are on the back of an instant noodle packet, in a factorial, and behind ctrl+z.","Sebagai konsep fundamental, algoritma menentukan seberapa mahal sebuah masalah diselesaikan. Contohnya ada di bungkus mie instan, di bilangan faktorial, dan di tombol undo.","2026-11-19T01:00:00.000Z",[326,281,284,126],"algoritma","\u002Fog\u002Fpentingnya-memahami-algoritma-dan-struktur-data.png",{"id":329,"title":330,"title_id":331,"slug":332},27,"About Algorithms and Data Structures","Tentang Algoritma dan Struktur Data","asd-intro",[334],{"authors_id":335},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},{"id":337,"title":338,"title_id":339,"slug":340,"excerpt":341,"excerpt_id":342,"has_translation":12,"published_at":343,"reading_time":140,"hidden_from_listing":15,"tags":344,"thumbnail_image":21,"og_image":345,"series":346,"authors":347},161,"Debugging Free Pascal with -gl and gdb","Men-debug Free Pascal dengan -gl dan gdb","pascal-debugging-fpc-gdb","A run with no prices ends at a hex address and status 217. `-gl` names the line, gdb names the values, and the mean of six positive prices comes out negative because `integer` is 2 bytes.","Jalan tanpa satu harga pun berakhir di alamat hex dan status 217. `-gl` menyebut barisnya, gdb menyebut nilainya, dan rata-rata dari enam harga positif keluar negatif karena `integer` berukuran 2 byte.","2026-11-18T01:00:00.000Z",[302,188],"\u002Fog\u002Fpascal-debugging-fpc-gdb.png",{"id":308,"title":67,"title_id":68,"slug":69},[348],{"authors_id":349},{"id":112,"name":113,"slug":114,"role":115,"profile_picture":21},[351,355,358,361],{"text":352,"depth":353,"id":354},"Ketika skripnya mati",2,"ketika-skripnya-mati",{"text":356,"depth":353,"id":357},"Perbaikan seminimal mungkin","perbaikan-seminimal-mungkin",{"text":359,"depth":353,"id":360},"Kenapa finally","kenapa-finally",{"text":362,"depth":353,"id":363},"Jebakannya","jebakannya",1795825297201]