# Week 13 @ Blockfuse Labs.
This past week, we began with an in-depth look at Object-Oriented Programming (OOP) in Python.
### 1. Introduction to Object-Oriented Programming (OOP)
* **What OOP is:**
A programming paradigm that organizes code into reusable objects (classes and instances).
* **Why OOP: **
It helps in creating modular, reusable, and maintainable code.
Key concepts covered:
Class: A blueprint/templete for creating objects.
Class Variables: Shared across all instances of a class.
Constructor (__init__): Special method used to initialize object attributes.
Difference between variables and class variables: Instance variables belong to specific objects, while class variables are shared among all objects.
Exampale:

### **2. Variable Scope in Python
We explored variable scope and why some variables behave differently inside functions.
Global Variables: Defined outside functions, accessible everywhere.
Local Variables: Defined inside a function, exist only within that function.
Mutable vs Immutable Types:
Numbers (int) are immutable → re-assignment inside a function creates a new variable unless declared global.
Lists & dictionaries are mutable → can be modified inside a function without redeclaring.
Example:
=
### 3. Practical Mini-Projects
We applied the week’s lessons in small real-world scenarios:
🔹 Voting System
Candidates stored in a dictionary.
Used *args to register multiple candidates.
Used **kwargs to update candidate details like party and region.
Rule: Each voter can only vote once.
Snippet:

### Employee ID Access System
User enters their employee ID.
If ID exists, they can request information.
Access depends on their clearance level.
Implemented without loops (using conditionals and dictionary lookups).
Snippet:

### 4. Conclusion
This past week’s training was a mix of theory and application:
OOP provided the foundation for structured programming.
Variable scope clarified how Python handles data internally.
Mini-projects (Voting System & Employee Access Control) gave real-world applications.
I understood how constructors, classes, and scope management help in building scalable programs, and how to apply them in practical use cases.
*Stay tuned for more weekly updates from my time at Blockfuse Lab, Jos!*
**#BlockfuseCohortIII #Web2 #SoftwareEngineeringJourney**