# CHAPTER 8: FURTHER PROGRAMMING

## 8.1 PROGRAMMING PARADIGMS

### 8.1.1 Low-Level Programming

**Characteristics:**

- Close to machine language
- Direct hardware access
- Instructions converted to machine code without compiler
- Non-portable (specific to processor)
- Small memory footprint
- Examples: Assembly, Machine code

**Addressing Modes:**

- Immediate: Data is value itself
- Direct: Address contains data
- Indirect: Address at address contains data
- Indexed: Address + index register contents

### 8.1.2 Imperative (Procedural) Programming

**Characteristics:**

- Sequence of statements changes state
- Explicit control flow
- Variables modified by assignments
- Based on Von Neumann architecture

**Examples:**

- C, Pascal, BASIC
- Python (also supports other paradigms)

### 8.1.3 Object-Oriented Programming (OOP)

**Key Terms:**

- **Object:** Instance of a class
- **Class:** Blueprint for creating objects
- **Property/Attribute:** Data in object
- **Method:** Function in object
- **Inheritance:** Child class inherits from parent
- **Polymorphism:** Same interface, different behaviour
- **Encapsulation:** Hiding internal details
- **Containment:** Object contains other objects

**Inheritance Example:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Cpython%3E-class-perso" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;PYTHON&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 231px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">class</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(193, 132, 1);"> Person</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">:</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">def</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">\_\_init\_\_</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);">self</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">,</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);"> name</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">,</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);"> age</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">):</span></span></div></div><div data-index="2" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">self</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">.name = name</span></span></div></div><div data-index="3" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">self</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">.age = age</span></span></div></div><div data-index="4" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span></span></div></div><div data-index="5" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">def</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(64, 120, 242);">get\_name</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);">self</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">):</span></span></div></div><div data-index="6" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">return</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">self</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">.name</span></span></div></div><div data-index="7" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;">  
</div></div><div data-index="8" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">class</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(193, 132, 1);"> Student(Person)</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">: </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(160, 161, 167); font-style: italic;">\# Inherits from Person</span></span></div></div><div data-index="9" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">def</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">\_\_init\_\_</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);">self</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">,</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);"> name</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">,</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);"> age</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">,</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);"> student\_id</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">):</span></span></div></div><div data-index="10" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">super</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">().</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">\_\_init\_\_</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">(name, age) </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(160, 161, 167); font-style: italic;">\# Call parent constructor</span></span></div></div><div data-index="11" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">self</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">.student\_id = student\_id</span></span></div></div></div></div></div></div></div></div>### 8.1.4 Declarative Programming

**Characteristics:**

- States what needs to be done, not how
- Non-procedural
- Control flow implicit
- Backtracking supported

**Example:**

- Prolog
- SQL

---

## 8.2 FILE PROCESSING

### 8.2.1 File Modes

<div class="sc-fYRIQK gLjTUz table-wrapper" id="bkmrk-mode-purpose-read-re" style="box-sizing: border-box; font-weight: 400; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; color: rgb(0, 0, 0); font-family: "', Ubuntu, -apple-system, 'system-ui', 'Segoe UI', system-ui, Roboto, Oxygen, Cantarell, 'Open Sans', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji"; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><table style="box-sizing: border-box; font-weight: normal; border-image: none 100% / 1 / 0 stretch; margin: 2em 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); text-indent: 0px; border-collapse: separate; -webkit-tap-highlight-color: transparent; --table-border-radius: 8px; font-size: 0.9em; width: 647px; border-radius: 8px; overflow: hidden; border-spacing: 0px; border: 0.5px solid rgba(0, 0, 0, 0.098);"><thead style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><th style="box-sizing: border-box; font-weight: 600; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; background-color: rgb(238, 238, 238); text-align: left;">Mode</th><th style="box-sizing: border-box; font-weight: 600; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: 0.5px solid rgba(0, 0, 0, 0.098); border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; background-color: rgb(238, 238, 238); text-align: left;">Purpose</th></tr></thead><tbody style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">READ</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: 0.5px solid rgba(0, 0, 0, 0.098); border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">Read from file</td></tr><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">WRITE</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: 0.5px solid rgba(0, 0, 0, 0.098); border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">Write to file (overwrites)</td></tr><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">APPEND</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: 0.5px solid rgba(0, 0, 0, 0.098); border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">Add to end of file</td></tr><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: 0.5px solid rgba(0, 0, 0, 0.098); border-bottom: none; border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">RANDOM</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: none; border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">Direct access</td></tr></tbody></table>

<div class="sc-MHKXp dNlhAz table-toolbar" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 8px; right: 8px; z-index: 10; display: flex; gap: 4px; border-radius: 4px; opacity: 0; transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div>### 8.2.2 Serial File Operations

**Reading:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Cpython%3E-file-%3D-open" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;PYTHON&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 105px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> = </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">open</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"data.txt"</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">, </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"r"</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">)</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">while</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">not</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> EOF(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">):</span></span></div></div><div data-index="2" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> line = READFILE(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">)</span></span></div></div><div data-index="3" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> process(line)</span></span></div></div><div data-index="4" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">CLOSEFILE(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">)</span></span></div></div></div></div></div></div></div></div>**Writing:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Cpython%3E-file-%3D-open-1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;PYTHON&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 63px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> = </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">open</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"data.txt"</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">, </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"w"</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">)</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">WRITEFILE(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">, </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"data"</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">)</span></span></div></div><div data-index="2" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">CLOSEFILE(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">)</span></span></div></div></div></div></div></div></div></div>### 8.2.3 Sequential File Operations

**Search:**

- Read records sequentially
- Compare key field
- Stop when found or key exceeds target

**Add:**

- Read from old file
- Write to new file
- Insert new record in correct position

**Delete:**

- Read from old file
- Write to new file
- Skip record to delete

### 8.2.4 Random File Operations

**Hashing:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-position-%3D-ha" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 21px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">Position = Hash(Key) MOD FileSize</span></span></div></div></div></div></div></div></div></div>**Direct Access:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Cpython%3E-seek%28file%2C-" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;PYTHON&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 63px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">SEEK(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">, position)</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">GETRECORD(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">, record)</span></span></div></div><div data-index="2" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">PUTRECORD(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">, record)</span></span></div></div></div></div></div></div></div></div>---

## 8.3 EXCEPTION HANDLING

### 8.3.1 Exceptions

**Definition:** Runtime errors that cause program to terminate if not handled.

**Common Exceptions:**

- Division by zero
- File not found
- Invalid input
- Memory overflow

### 8.3.2 Handling Exceptions

**Try-Except Structure:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Cpython%3E-try%3A-%23-code" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;PYTHON&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 252px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">try</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">:</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(160, 161, 167); font-style: italic;">\# Code that might cause error</span></span></div></div><div data-index="2" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> = </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">open</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"data.txt"</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">, </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"r"</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">)</span></span></div></div><div data-index="3" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> data = </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">.read()</span></span></div></div><div data-index="4" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">except</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">FileNotFoundError</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">:</span></span></div></div><div data-index="5" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">print</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"File not found"</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">)</span></span></div></div><div data-index="6" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">except</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">Exception</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">as</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> e:</span></span></div></div><div data-index="7" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">print</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">(</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">f</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"Error: </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);">{</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">e</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(152, 104, 1);">}</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">"</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">)</span></span></div></div><div data-index="8" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">finally</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">:</span></span></div></div><div data-index="9" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(160, 161, 167); font-style: italic;">\# Always executes</span></span></div></div><div data-index="10" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">if</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(80, 161, 79);">'file'</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(166, 38, 164);">in</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(1, 132, 188);">locals</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">():</span></span></div></div><div data-index="11" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);"> </span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(228, 86, 73);">file</span><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal; color: rgb(56, 58, 66);">.close()</span></span></div></div></div></div></div></div></div></div>**Purpose:**

- Prevent program crash
- Provide meaningful error messages
- Allow graceful recovery