An educational Jupyter notebook project developed by DNC to teach fundamental Python concepts through practical task management implementation.
Overview β’ Features β’ Installation β’ Usage β’ Notebook Structure β’ Learning Objectives β’ Technologies β’ Contributing β’ License
This project is a comprehensive task management system implemented in Python using Jupyter notebooks as part of DNC's (Digital Nation Course) educational curriculum. The system demonstrates essential programming concepts through a practical application that allows users to manage tasks with different priority levels.
The project serves as an interactive learning experience, combining theoretical concepts with hands-on implementation in a notebook environment that facilitates experimentation and learning.
- Add Tasks: Create new tasks with descriptions and priority assignments
- Remove Tasks: Delete specific tasks from the system
- List Tasks: Display all current tasks with their priority levels
- Save Tasks: Persist task data to files for future sessions
- Interactive Menu: User-friendly command-line interface
- High Priority: Critical tasks requiring immediate attention
- Medium Priority: Important tasks with moderate urgency
- Low Priority: Tasks that can be completed when time permits
- Step-by-step Implementation: Code broken down into digestible sections
- Concept Explanations: Detailed explanations of Python concepts used
- Interactive Examples: Live code cells for experimentation
- Python 3.7 or higher
- Jupyter Notebook or JupyterLab
- Basic understanding of Python syntax
- Clone the repository:
git clone https://github.com/Laurentius96/Priority_Task_Manager.git- Navigate to project directory:
cd Priority_Task_Manager- Run the
main.ipynbnotebook in a Jupyter environment:
jupyter notebook main.ipynb- Alternatively, run the script directly:
python -m main.pyThe notebook is structured in sequential cells that build upon each other. Execute cells in order using Shift + Enter.
Task Data Structure:
# Example task structure used in the notebook
tasks = [
{"description": "Study Python", "priority": "High"},
{"description": "Go to gym", "priority": "Medium"},
{"description": "Buy groceries", "priority": "Low"}
]Adding a Task Function:
def add_task(tasks, description, priority):
"""
Add a new task to the task list
Parameters:
tasks (list): Current list of tasks
description (str): Task description
priority (str): Task priority level
"""
new_task = {"description": description, "priority": priority}
tasks.append(new_task)
print(f"Task '{description}' added with {priority} priority!")
return tasksExpected Output:
Task 'Study Python' added with High priority!
Current tasks: 3
def display_menu():
print("\n=== TASK MANAGER ===")
print("1. Add Task")
print("2. Remove Task")
print("3. List Tasks")
print("4. Save Tasks")
print("5. Exit")
return input("Choose an option (1-5): ")Sample Execution Result:
=== TASK MANAGER ===
1. Add Task
2. Remove Task
3. List Tasks
4. Save Tasks
5. Exit
Choose an option (1-5): 3
=== CURRENT TASKS ===
1. Study Python - Priority: High
2. Go to gym - Priority: Medium
3. Buy groceries - Priority: Low
task_manager.ipynb
βββ 1. Introduction & Setup
β βββ Project overview
β βββ Learning objectives
β βββ Import statements
βββ 2. Data Structures
β βββ Task representation
β βββ List operations
β βββ Dictionary usage
βββ 3. Core Functions
β βββ add_task()
β βββ remove_task()
β βββ list_tasks()
β βββ save_tasks()
βββ 4. Control Flow
β βββ Menu system
β βββ User input handling
β βββ Conditional logic
βββ 5. File Operations
β βββ Saving to file
β βββ Loading from file
β βββ Error handling
βββ 6. Main Program Loop
β βββ Interactive execution
β βββ Menu navigation
β βββ Program termination
βββ 7. Exercises & Extensions
βββ Practice problems
βββ Enhancement ideas
βββ Further learning resources
This notebook teaches the following Python concepts through practical implementation:
- Lists: Managing collections of tasks
- Dictionaries: Storing task attributes
- Data manipulation: Adding, removing, and modifying data
- Conditional statements: Menu navigation and decision making
- Loops: Iterating through task collections
- Function definitions: Code organization and reusability
- Writing files: Persisting task data
- Reading files: Loading saved tasks
- Error handling: Managing file operations safely
- Input validation: Ensuring data integrity
- Menu systems: Creating user-friendly interfaces
- Output formatting: Presenting information clearly
- Python 3.x: Core programming language
- Jupyter Notebook: Interactive development environment
- Built-in Libraries:
os: File system operationsjson: Data serialization (optional enhancement)
- Pandas: Data manipulation (for advanced features)
def list_tasks(tasks):
"""Display all tasks with their priorities"""
if not tasks:
print("No tasks available.")
return
print("\n=== CURRENT TASKS ===")
for i, task in enumerate(tasks, 1):
print(f"{i}. {task['description']} - Priority: {task['priority']}")Execution Result:
# Sample execution in notebook cell
tasks = [
{"description": "Complete Python project", "priority": "High"},
{"description": "Review code documentation", "priority": "Medium"}
]
list_tasks(tasks)Output:
=== CURRENT TASKS ===
1. Complete Python project - Priority: High
2. Review code documentation - Priority: Medium
def save_tasks_to_file(tasks, filename="tasks.txt"):
"""Save tasks to a text file"""
try:
with open(filename, "w") as file:
for task in tasks:
file.write(f"{task['description']},{task['priority']}\n")
print(f"Tasks saved to {filename} successfully!")
except Exception as e:
print(f"Error saving tasks: {e}")Expected Result:
Tasks saved to tasks.txt successfully!
File created: tasks.txt
Content preview:
Complete Python project,High
Review code documentation,Medium
The project can be extended with additional features:
- Task Categories: Group tasks by work, personal, etc.
- Due Dates: Add deadline tracking functionality
- Task Status: Implement completed/pending status
- Data Visualization: Create charts showing task distribution
- Export Options: Save tasks in different formats (CSV, JSON)
This educational project welcomes contributions to improve the learning experience:
- Fork the repository
- Create a feature branch (
git checkout -b feature/educational-enhancement) - Make your changes with clear documentation
- Add examples and explanations for new concepts
- Submit a pull request with detailed description
This project is part of DNC's educational curriculum and is available for learning purposes.
CC BY-NC-ND 4.0 License
This repository is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
- β You can share β You are free to copy and redistribute the material in any medium or format
- β No commercial use β You may not use the material for commercial purposes
- β No derivatives β You may not remix, transform, or build upon the material
- β Attribution required β You must give appropriate credit, provide a link to the license, and indicate if changes were made
For the complete license terms, please see the LICENSE.md file.
- Python Documentation: python.org
- Jupyter Notebook Guide: jupyter.org
- Data Structures Tutorial: Additional learning materials in the notebook
Developed with π by Lorenzo C. Bianchi feat. DNC Educational Team
Learning through practice - building real solutions with code!