BTCE | 5th Sem
Adv-Python SubjectUnit 3

Adv-Python Unit 3: Complete Concept Guide

Unit III: Python Modules and File Handling -> Generated and Prepared By Thiruselvan (ThiruXD)

1. Introduction to Python Modules

1.1 What is a Module?

A module is a Python file (with .py extension) that contains:

  • Functions
  • Classes
  • Variables
  • Executable statements

The file name becomes the module name without the .py extension. For example, calculator.py becomes the module calculator.

Key Insight: A module is not a separate programming language. It is simply a Python file that can be reused by importing it into another Python file.

1.2 Why Use Modules?

ReasonExplanationExample
Code ReuseWrite once, use in many programsSame tax calculation function in multiple billing programs
OrganisationSeparate large programs into logical filesDatabase code, validation code, report code in separate modules
MaintainabilityChange one module without rewriting the full applicationUpdate one email-sending module used across the project
TestingTest individual modules independentlyTest calculator functions before using in main program
TeamworkDifferent developers work on different modulesOne developer on login.py, another on reports.py

1.3 Module, Package, and Library

ConceptMeaningSimple Example
ModuleOne Python filemath_tools.py
PackageA folder grouping related modules (usually contains __init__.py)data_utils/ folder with cleaning.py, validation.py
LibraryA collection of modules and packages for specific tasksNumPy, Pandas, Matplotlib

Hierarchy: Library ⊃ Package ⊃ Module

1.4 Python Module Workflow

┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌──────────────┐    ┌─────────────┐
│ 1. Create   │ →  │ 2. Write &  │ →  │ 3. Package  │ →  │ 4. Distribute│ →  │ 5. Import & │
│   Module    │    │    Test     │    │   Module    │    │              │    │    Reuse    │
└─────────────┘    └─────────────┘    └─────────────┘    └──────────────┘    └─────────────┘
       ↑                                                                          │
       └────────────────────── Iterate & Improve ─────────────────────────────────┘

Step 1: Create Module — Write functions, classes, and variables in a .py file.

Step 2: Write & Test — Test with different inputs to verify correctness and reliability.

Step 3: Package Module — Organize into standard directory structure with __init__.py, metadata files.

Step 4: Distribute — Share through PyPI or private repository; version release.

Step 5: Import & Reuse — Import into multiple programs using pip install and import.

Iterate & Improve — Fix bugs, optimize, add features; update, test, repackage, redistribute.


2. Creating and Using Modules

2.1 Steps to Create a Module

  1. Create a new Python file with a meaningful name (e.g., mymath.py).
  2. Define functions, variables, or classes inside the file.
  3. Save the file in the same folder as the program that will use it.
  4. Use the import statement in another Python file.
  5. Access module members using dot notation: module_name.function_name().

2.2 Example: User-Defined Module

File: calculator_tools.py

def add(a, b):
    return a + b

def subtract(a, b):
    return a - b

PI = 3.14159

File: main.py

import calculator_tools

print(calculator_tools.add(10, 5))      # 15
print(calculator_tools.subtract(10, 5)) # 5
print(calculator_tools.PI)              # 3.14159

2.3 Explanation Table

Part of ProgramRole
calculator_tools.pyModule file containing reusable functions and variables
main.pyMain program that imports and uses the module
import calculator_toolsLoads the module into the program
calculator_tools.add(10, 5)Calls the add function using dot notation

2.4 Best Practices for Creating Modules

  • Keep each module focused on one main purpose.
  • Use meaningful function and variable names.
  • Avoid writing too much executable code directly at module level.
  • Add comments or docstrings to explain important functions.
  • Test the module independently before using it in a larger project.

3. Naming and Renaming Modules

3.1 Module Naming Rules

RuleCorrect ExampleIncorrect Example
Use lowercase lettersstudent_records.pyStudentRecords.py
Use underscores for readabilityfile_utils.pyfile-utils.py
Do not begin with a numbermodule3_notes.py3module.py
Avoid spacesdata_cleaning.pydata cleaning.py
Avoid names of built-in modulesmy_math_tools.pymath.py

3.2 Renaming Modules Using Aliases

Python allows an imported module to be given a shorter name using the as keyword. This does not rename the original file; it only creates an alias inside the current program.

import math as m
print(m.sqrt(25))   # 5.0
print(m.pi)         # 3.14159...

import random as rd
number = rd.randint(1, 10)
print(number)

Common Aliases:

  • import numpy as np
  • import pandas as pd
  • import matplotlib.pyplot as plt

Important: Do not create files named math.py, random.py, json.py, or re.py in your project folder. These names can hide the original built-in modules and cause confusing errors.


4. Variables in Modules, Built-in Modules, and dir() Function

4.1 Variables in Modules

A module can store variables just like a normal Python program. These variables can be accessed after importing the module. Module-level variables are useful for:

  • Constants
  • Configuration values
  • Version numbers
  • Shared settings

File: college_info.py

college_name = "ABC Institute"
course = "Python Programming"
semester = 5

File: main.py

import college_info

print(college_info.college_name)  # ABC Institute
print(college_info.course)        # Python Programming
print(college_info.semester)      # 5

4.2 Built-in Modules

Python includes many ready-to-use modules in its standard library.

Built-in ModulePurposeExample Use
mathMathematical functions and constantssqrt(), ceil(), pi
randomRandom number generationrandint(), choice(), shuffle()
datetimeDates and timesdate.today(), datetime.now()
osOperating system interactionlistdir(), mkdir(), path.exists()
sysPython interpreter informationsys.version, sys.path
jsonJSON parsing and conversionloads(), dumps(), load(), dump()
reRegular expression operationssearch(), findall(), sub()
statisticsBasic statisticsmean(), median(), mode()

Examples:

import math
print(math.sqrt(64))  # 8.0

import random
print(random.choice(["red", "blue", "green"]))

from datetime import date
print(date.today())

4.3 The dir() Function

The dir() function returns a list of names available inside an object or module. It is useful for exploring what functions, classes, constants, and attributes are provided by a module.

import math
print(dir(math))
print(math.sqrt(16))
Use of dir()Meaning
dir(math)Displays names available in the math module
dir(str)Displays methods available for string objects
dir()Displays names available in the current scope

5. Importing from Modules

5.1 Types of Import Statements

Import StyleSyntaxWhen to Use
Import full moduleimport mathWhen many functions from the module are required
Import with aliasimport math as mWhen a shorter name improves readability
Import one namefrom math import sqrtWhen only one function or variable is needed
Import multiple namesfrom math import sqrt, piWhen a few selected names are needed
Import all namesfrom math import *Generally avoided; can create name conflicts

Examples:

# Import full module
import math
print(math.sqrt(81))  # 9.0

# Import specific names
from math import sqrt, pi
print(sqrt(81))  # 9.0
print(pi)        # 3.14159...

# Import with alias
import math as m
print(m.factorial(5))  # 120

5.2 The __name__ Variable

When a Python file is run directly, its special variable __name__ is set to "__main__". When the same file is imported as a module, __name__ becomes the module name. This allows a file to contain test code that runs only when the file is executed directly.

File: greetings.py

def welcome(name):
    return "Welcome, " + name

if __name__ == "__main__":
    print(welcome("Student"))

Why it matters: The __name__ == "__main__" pattern prevents test code from running automatically when a module is imported into another program.


6. JSON in Python

6.1 What is JSON?

JSON stands for JavaScript Object Notation. It is a lightweight text format used for storing and exchanging structured data. JSON is widely used in:

  • Web applications
  • APIs
  • Configuration files
  • Databases
  • Data transfer between systems

6.2 JSON Data Types and Python Mapping

JSON TypePython EquivalentExample
objectdict{"name": "Amit"}
arraylist[10, 20, 30]
stringstr"Python"
numberint or float25 or 3.14
true / falseTrue / Falsetrue becomes True
nullNonenull becomes None

6.3 The json Module

FunctionPurpose
json.loads()Parses a JSON string and converts it into a Python object
json.dumps()Converts a Python object into a JSON-formatted string
json.load()Reads JSON data from a file and converts it into a Python object
json.dump()Writes a Python object into a file in JSON format

Memory Aid:

  • loads/dumps → work with strings (the ‘s’ stands for string)
  • load/dump → work with files

6.4 Parsing JSON Strings

import json

student_json = '{"name": "Ravi", "age": 21, "marks": 88}'
student = json.loads(student_json)

print(student["name"])   # Ravi
print(student["marks"])  # 88

6.5 Converting Python to JSON

import json

student = {
    "name": "Ravi",
    "age": 21,
    "marks": 88
}

json_string = json.dumps(student, indent=4)
print(json_string)

6.6 Parsing Nested JSON

import json

data = '''
{
    "student": {
        "name": "Meena",
        "age": 20,
        "subjects": ["Python", "DBMS", "AI"]
    }
}
'''

obj = json.loads(data)
print(obj["student"]["name"])        # Meena
print(obj["student"]["subjects"][0]) # Python

6.7 Reading and Writing JSON Files

import json

# Writing JSON to file
student = {
    "name": "Meena",
    "semester": 5,
    "skills": ["Python", "SQL"]
}

with open("student.json", "w") as file:
    json.dump(student, file, indent=4)

# Reading JSON from file
with open("student.json", "r") as file:
    data = json.load(file)

print(data["skills"])  # ['Python', 'SQL']

6.8 JSON Errors and Solutions

Common JSON ErrorReasonSolution
JSONDecodeErrorInvalid JSON syntax (missing quotes, extra comma)Validate JSON format before parsing
KeyErrorTrying to access a key that does not existUse get() or check if key exists
TypeErrorTrying to serialize an unsupported Python objectConvert object to a serializable type

Safer way to read optional values:

name = data.get("name", "Unknown")
print(name)

7. Regular Expressions and RegEx Functions

7.1 What is a Regular Expression?

A Regular Expression (RegEx) is a pattern used to match text. It is useful for:

  • Validating input (emails, phone numbers)
  • Extracting values from text
  • Searching documents
  • Cleaning text
  • Replacing unwanted content

7.2 Regular Expression Workflow

┌───────────┐    ┌───────────┐    ┌──────────────┐    ┌─────────────────┐    ┌──────────────┐
│ 1. Pattern│ →  │ 2. Compile│ →  │ 3. Search/   │ →  │ 4. Process/     │ →  │ 5. Validate/ │
│   Define  │    │  Pattern  │    │    Match     │    │    Extract      │    │    Output    │
└───────────┘    └───────────┘    └──────────────┘    └─────────────────┘    └──────────────┘

Step 1: Pattern — Define the regular expression pattern. Step 2: Compile — Compile the pattern into a regex object. Step 3: Search/Match — Search the target string for matches. Step 4: Process/Extract — Process the matches or extract the needed information. Step 5: Validate/Output — Validate results and output or store them.

7.3 RegEx Metacharacters

SymbolMeaningExample
.Matches any single character except newlinea.c matches abc, axc
^Matches the start of a string^Hello
$Matches the end of a stringend$
*Matches zero or more repetitionsab* matches a, ab, abb
+Matches one or more repetitionsab+ matches ab, abb
?Matches zero or one repetitioncolou?r matches color or colour
[]Matches one character from a set[aeiou]
\dMatches a digit\d+ matches 123
\wMatches a word character\w+
\sMatches whitespace\s+

7.4 Common Functions in the re Module

FunctionPurpose
re.search(pattern, text)Searches anywhere in the string; returns first match
re.match(pattern, text)Checks for a match only at the beginning of the string
re.fullmatch(pattern, text)Checks whether the entire string matches the pattern
re.findall(pattern, text)Returns all matching substrings as a list
re.finditer(pattern, text)Returns match objects one by one for all matches
re.split(pattern, text)Splits a string based on the pattern
re.sub(pattern, replacement, text)Replaces matching text with new text
re.compile(pattern)Compiles a pattern for repeated use

7.5 RegEx Examples

Example 1: Find all numbers

import re
text = "My marks are 85 and my attendance is 92"
numbers = re.findall(r"\d+", text)
print(numbers)  # ['85', '92']

Example 2: Validate email

import re
email = "student@example.com"
pattern = r"^[\w.-]+@[\w.-]+\.\w+$"

if re.fullmatch(pattern, email):
    print("Valid email")
else:
    print("Invalid email")

Example 3: Clean whitespace

import re
sentence = "Python    is   easy"
cleaned = re.sub(r"\s+", " ", sentence)
print(cleaned)  # Python is easy

Raw Strings: RegEx patterns are usually written as raw strings using r"pattern". This avoids confusion with Python escape characters such as \n and \t.


8. Exception Handling

8.1 What is an Exception?

An exception is an error that occurs while a program is running. Without exception handling, the program stops immediately. With exception handling, the program can:

  • Display a meaningful message
  • Recover from the error
  • Close resources safely

8.2 Basic try-except Structure

try:
    number = int(input("Enter a number: "))
    print(100 / number)
except ValueError:
    print("Please enter only numbers.")
except ZeroDivisionError:
    print("Cannot divide by zero.")

8.3 Common Exceptions in Python

ExceptionWhen It OccursExample
ValueErrorCorrect type but invalid valueint("abc")
ZeroDivisionErrorDivision by zero10 / 0
FileNotFoundErrorFile does not existopen("missing.txt")
KeyErrorDictionary key is missingstudent["age"] when age is absent
IndexErrorList index is out of rangeitems[10]
TypeErrorOperation on incompatible types"5" + 2

8.4 Multiple Exceptions

Multiple except blocks are used when different errors require different responses. Python checks the except blocks from top to bottom and runs the first matching block.

try:
    x = int(input("Enter number: "))
    y = int(input("Enter divisor: "))
    print(x / y)
except ValueError:
    print("Invalid input.")
except ZeroDivisionError:
    print("Cannot divide by zero.")
except Exception as e:
    print("Unexpected error:", e)

8.5 else and finally Blocks

try:
    file = open("data.txt", "r")
    content = file.read()
except FileNotFoundError:
    print("File not found.")
else:
    print("File read successfully.")
finally:
    print("Program finished.")
  • else block: Runs only if no exception occurs.
  • finally block: Runs whether or not an exception occurs. Commonly used to close files, release resources, or display final messages.

8.6 Raising Exceptions

def set_age(age):
    if age < 0:
        raise ValueError("Age cannot be negative")
    return age

print(set_age(20))   # 20
# print(set_age(-5)) # Raises ValueError

Best Practice: Avoid using a bare except: block because it catches all errors and can hide programming mistakes. Catch specific exceptions whenever possible.


9. File Handling

9.1 What is File Handling?

File handling allows a program to store data permanently and read data from external sources. Python can work with text files, CSV files, JSON files, binary files, logs, and many other formats.

9.2 Safe File Handling Workflow

┌──────────┐    ┌──────────────┐    ┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│ 1. Open  │ →  │ 2. Read/     │ →  │ 3. Process   │ →  │ 4. Close     │ →  │ 5. Handle    │
│   File   │    │    Write     │    │    Data      │    │   Safely     │    │    Errors    │
└──────────┘    └──────────────┘    └──────────────┘    └──────────────┘    └──────────────┘

Step 1: Open File — Open in appropriate mode (read, write, append). Step 2: Read/Write — Read from or write to the file as required. Step 3: Process Data — Process, validate, or transform data as needed. Step 4: Close Safely — Close the file to release resources and ensure data is saved. Step 5: Handle Errors — Catch and handle exceptions to prevent crashes and ensure reliability.

9.3 File Opening Modes

ModeMeaningUse Case
rRead mode. File must existRead an existing text file
wWrite mode. Creates or overwrites fileSave new output
aAppend mode. Adds content at the endAdd log messages
xCreate mode. Fails if file existsCreate a new file safely
bBinary modeRead images, audio, binary data
tText mode (default)Read normal text files
+Read and write modeUpdate file content

9.4 Opening and Closing Files

The open() function is used to open a file. It returns a file object. Files should be closed after use to avoid resource leakage. The recommended method is to use the with statement because it closes the file automatically.

# Using with statement (recommended)
with open("students.txt", "r") as file:
    print(file.read())

# Manual opening and closing
file = open("students.txt", "r")
print(file.read())
file.close()

9.5 Reading Files

# Read entire file
with open("students.txt", "r") as file:
    print(file.read())

# Read one line
with open("students.txt", "r") as file:
    print(file.readline())

# Read line by line
with open("students.txt", "r") as file:
    for line in file:
        print(line.strip())

9.6 Writing and Appending Files

# Writing (overwrites existing content)
with open("output.txt", "w") as file:
    file.write("First line\n")
    file.write("Second line\n")

# Appending (adds to end)
with open("output.txt", "a") as file:
    file.write("Appended line\n")

9.7 Working with File Paths and Encoding

A file path tells Python where the file is located. If only the file name is given, Python searches in the current working directory. For text files, UTF-8 encoding is commonly used because it supports many languages and symbols.

from pathlib import Path

path = Path("data") / "students.txt"

with open(path, "r", encoding="utf-8") as file:
    content = file.read()

print(content)

9.8 File Handling with Exceptions

try:
    with open("marks.txt", "r") as file:
        marks = file.read()
        print(marks)
except FileNotFoundError:
    print("The file marks.txt was not found.")

9.9 Important File Handling Concepts

ConceptExplanation
Current working directoryThe folder from which the Python program is currently running
Absolute pathFull path from the root of the system
Relative pathPath relative to the current working directory
EncodingRule used to convert text into bytes and bytes into text
BufferingTemporary storage used while reading or writing data

10. Integrated Practical Example

The following example combines important concepts: importing modules, reading JSON data, validating email using RegEx, handling exceptions, and writing output to a file.

import json
import re

EMAIL_PATTERN = r"^[\w.-]+@[\w.-]+\.\w+$"

try:
    with open("students.json", "r", encoding="utf-8") as file:
        students = json.load(file)

    valid_students = []

    for student in students:
        email = student.get("email", "")
        if re.fullmatch(EMAIL_PATTERN, email):
            valid_students.append(student)

    with open("valid_students.json", "w", encoding="utf-8") as file:
        json.dump(valid_students, file, indent=4)

    print("Valid student records saved successfully.")

except FileNotFoundError:
    print("Input JSON file not found.")
except json.JSONDecodeError:
    print("Invalid JSON format.")
except Exception as error:
    print("Unexpected error:", error)

Concepts Demonstrated

Concept UsedWhere It Appears in the Program
Module importjson and re modules imported at the beginning
JSON parsingjson.load(file) reads JSON from a file into Python objects
RegEx validationre.fullmatch() checks whether the email format is valid
File writingjson.dump() writes valid records into a new JSON file
Exception handlingSpecific except blocks handle missing file and invalid JSON

11. Unit Summary

PYTHON MODULES AND FILE HANDLING
│
├── Introduction to Modules
│   ├── Definition (.py file with reusable code)
│   ├── Importance (reuse, organisation, maintainability, testing, teamwork)
│   └── Module vs Package vs Library
│
├── Creating and Using Modules
│   ├── Steps to create
│   ├── User-defined module example
│   └── Best practices
│
├── Naming and Renaming Modules
│   ├── Naming rules
│   └── Aliases (as keyword)
│
├── Variables, Built-in Modules, dir()
│   ├── Module-level variables
│   ├── Common built-in modules
│   └── dir() function
│
├── Importing from Modules
│   ├── Import styles
│   └── __name__ == "__main__" pattern
│
├── JSON in Python
│   ├── JSON data types → Python mapping
│   ├── json.loads/dumps/load/dump
│   ├── Nested JSON parsing
│   ├── File read/write
│   └── Error handling
│
├── Regular Expressions
│   ├── Metacharacters
│   ├── re module functions
│   └── Examples (findall, fullmatch, sub)
│
├── Exception Handling
│   ├── try-except
│   ├── Multiple exceptions
│   ├── else, finally
│   └── Raising exceptions
│
└── File Handling
    ├── Modes (r, w, a, x, b, t, +)
    ├── Reading, writing, appending
    ├── File paths and encoding
    └── File handling with exceptions

12. Key Formulas and Syntax — Quick Reference

ConceptSyntax/Example
Import full moduleimport math
Import with aliasimport math as m
Import specific namesfrom math import sqrt, pi
Import allfrom math import *
Module variable accessmodule_name.variable
List module contentsdir(module_name)
Main guardif __name__ == "__main__":
Parse JSON stringjson.loads(json_string)
Convert to JSON stringjson.dumps(python_obj)
Read JSON filejson.load(file)
Write JSON filejson.dump(obj, file, indent=4)
RegEx searchre.search(pattern, text)
RegEx match at startre.match(pattern, text)
RegEx full matchre.fullmatch(pattern, text)
RegEx find allre.findall(pattern, text)
RegEx replacere.sub(pattern, replacement, text)
RegEx splitre.split(pattern, text)
RegEx compilere.compile(pattern)
Try-excepttry: ... except ValueError: ...
Try-except-else-finallytry: ... except: ... else: ... finally: ...
Raise exceptionraise ValueError("message")
Open file (read)with open("file.txt", "r") as f:
Open file (write)with open("file.txt", "w") as f:
Open file (append)with open("file.txt", "a") as f:
Read entire filef.read()
Read one linef.readline()
Read line by linefor line in f:
Write to filef.write("text")
File pathPath("data") / "students.txt"
Encodingopen(path, "r", encoding="utf-8")

13. Exam-Focused Points

  1. Module definition — A .py file with reusable code.
  2. Module vs Package vs Library — Module = file; Package = folder; Library = collection.
  3. import vs from ... import — Full module vs specific names.
  4. Aliases — import numpy as np; does not rename the file.
  5. dir() function — Lists module contents.
  6. __name__ == "__main__" — Prevents test code from running on import.
  7. JSON functions — loads/dumps for strings; load/dump for files.
  8. JSON data type mapping — null → None; true → True.
  9. RegEx metacharacters — ., ^, $, , +, ?, [], \d, \w, \s.
  10. re functions — search, match, fullmatch, findall, sub, split, compile.
  11. Raw strings — Use r"pattern" to avoid escape character issues.
  12. Exception types — ValueError, ZeroDivisionError, FileNotFoundError, KeyError, IndexError, TypeError.
  13. else vs finally — else runs if no exception; finally always runs.
  14. File modes — r (read), w (write/overwrite), a (append), x (create), b (binary), t (text), + (read/write).
  15. with statement — Automatically closes files.
  16. Encoding — UTF-8 for multilingual text.
  17. Avoid bare except: — Catch specific exceptions.
  18. Integrated example — Combines modules, JSON, RegEx, exceptions, and file handling.

14. Glossary of Key Terms

TermDefinition
ModuleA Python file with a .py extension containing reusable code
PackageA folder that groups related modules
LibraryA collection of modules and packages for specific tasks
ImportBringing code from one module into another program
AliasAn alternate short name given using the as keyword
Built-in ModuleA module included with Python installation
dir() FunctionLists names and attributes available inside an object or module
JSONJavaScript Object Notation; lightweight text format for structured data
Regular ExpressionA pattern language for searching, validating, extracting, and replacing text
ExceptionAn error detected during program execution
File HandlingOpening, reading, writing, appending, and closing files
__name__Special variable set to "__main__" when file is run directly
try-exceptBlock for handling exceptions
finallyBlock that always runs, whether exception occurs or not
with statementContext manager that auto-closes files

On this page

1. Introduction to Python Modules1.1 What is a Module?1.2 Why Use Modules?1.3 Module, Package, and Library1.4 Python Module Workflow2. Creating and Using Modules2.1 Steps to Create a Module2.2 Example: User-Defined Module2.3 Explanation Table2.4 Best Practices for Creating Modules3. Naming and Renaming Modules3.1 Module Naming Rules3.2 Renaming Modules Using Aliases4. Variables in Modules, Built-in Modules, and dir() Function4.1 Variables in Modules4.2 Built-in Modules4.3 The dir() Function5. Importing from Modules5.1 Types of Import Statements5.2 The __name__ Variable6. JSON in Python6.1 What is JSON?6.2 JSON Data Types and Python Mapping6.3 The json Module6.4 Parsing JSON Strings6.5 Converting Python to JSON6.6 Parsing Nested JSON6.7 Reading and Writing JSON Files6.8 JSON Errors and Solutions7. Regular Expressions and RegEx Functions7.1 What is a Regular Expression?7.2 Regular Expression Workflow7.3 RegEx Metacharacters7.4 Common Functions in the re Module7.5 RegEx Examples8. Exception Handling8.1 What is an Exception?8.2 Basic try-except Structure8.3 Common Exceptions in Python8.4 Multiple Exceptions8.5 else and finally Blocks8.6 Raising Exceptions9. File Handling9.1 What is File Handling?9.2 Safe File Handling Workflow9.3 File Opening Modes9.4 Opening and Closing Files9.5 Reading Files9.6 Writing and Appending Files9.7 Working with File Paths and Encoding9.8 File Handling with Exceptions9.9 Important File Handling Concepts10. Integrated Practical ExampleConcepts Demonstrated11. Unit Summary12. Key Formulas and Syntax — Quick Reference13. Exam-Focused Points14. Glossary of Key Terms