A step-by-step learning journey through Python fundamentals.
This repository contains code examples and notes for learning Python programming fundamentals. The content is organized by learning days, with each day focusing on specific concepts.
- Installing Python
- Creating and running Python files
- Python comments and basic syntax
- Variables and their usage
- Data types (primitive and non-primitive)
- Operators (arithmetic, comparison, logical, assignment)
- Control Flow statements:
- If, if-else, elif conditions
- Nested if statements
- While loops
- For loops
- Break, continue, and pass statements
- Functions:
- Function definition and calling
- Return values
- Parameters and arguments
- Data Structures:
- Lists (creation, indexing, slicing, adding/removing elements)
- Tuples (immutable collections)
- Sets (unique collections)
- Dictionaries (key-value pairs)
- Range objects
- Object-Oriented Programming concepts
- Working with classes and objects
- Database connectivity
- Basic SQL operations
- CRUD operations with Python and SQL
- app.py: Introduction to Python basics with simple print statements
- day_two.py: Comprehensive examples of variables, data types, and operators
- day_three.py: Examples of control flow statements and functions
- day_four.py: Examples of Python data structures
- day_five.py: Introduction to Object-Oriented Programming
- library_app.py: Implementation of the Library Management System challenge
- config.py: Configuration file for database connections and environment variables
- notes.txt: Outline of topics covered by day
- LICENSE: MIT License for this project
- .gitignore: Specifies intentionally untracked files to ignore (includes .env and env/)
The repository includes a complete Library Management System application that demonstrates:
- Configuration (
config.py): Manages database connections and environment variables - Main Application (
library_app.py): Entry point for the library management system with the following features:- User authentication for librarians and members
- Book catalog management
- Borrowing and returning processes
- Member management
- Reporting functionality
- Tables for Books, Members, Librarians, and Transactions
- Relationships between entities using foreign keys
- CRUD operations implemented for all main entities
python library_app.pyThe repository includes programming challenges to practice Python concepts:
- Challenge One: Building a library management system with classes for Person, Student, Book, and Librarian, demonstrating inheritance principles.
This project uses a virtual environment to manage dependencies. Follow these steps to set it up:
-
Create a virtual environment:
python3 -m venv env
-
Activate the virtual environment:
source env/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Deactivate the virtual environment when done:
deactivate
-
Create a virtual environment:
python -m venv env
-
Activate the virtual environment:
.\env\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Deactivate the virtual environment when done:
deactivate
The project uses environment variables for sensitive information like database credentials. Create a .env file in the project root with the following variables:
DB_HOST=your_database_host
DB_USER=your_database_user
DB_PASSWORD=your_database_password
DB_NAME=your_database_name
These environment variables are loaded by config.py to establish database connections securely without exposing credentials in the code.
To run these examples, you need Python installed on your system. You can run any of the Python files using:
python app.py
# or
python day_two.py
# or
python day_three.py
# or
python day_four.py
# or
python day_five.pyThe repository includes practical examples like:
- Basic printing and calculations
- Variable assignment and manipulation
- Rectangle calculator (user input, calculations, and output)
- Control flow demonstrations with loops and conditionals
- Function definitions with various parameter types
- Data structures implementation and manipulation
- Object-oriented programming implementations
- SQL database operations
This project is licensed under the MIT License - see the LICENSE file for details.