diff --git a/day-03/README.md b/day-03/README.md new file mode 100644 index 0000000..bc498a6 --- /dev/null +++ b/day-03/README.md @@ -0,0 +1,93 @@ +# Day 03 – Strengthening Python Fundamentals for DevOps + +## Task + +Today’s goal is to **improve and refine your existing Python scripts** using better structure and basic error handling. + +You will take **any one script** from: +- Day 01 (System Health Script), or +- Day 02 (API & JSON Script) + +And enhance it by: +- Organizing the code into **functions** +- Adding **basic exception handling** (`try / except`) +- Improving variable names and readability +- Ensuring the script does not crash on common errors + +This task focuses on writing **cleaner and safer Python code**, which is critical for DevOps automation. + + +## Expected Output + +- One improved Python script +- Script should: + - Run without crashing + - Handle at least one error gracefully +- Output should be visible in terminal + + + +## Guidelines + +- Use: + - `try / except` for error handling + - Functions to separate logic +- Example errors to handle: + - Invalid user input + - API request failure + - File not found +- Follow basic Python coding standards (PEP8) +- Do not rewrite everything from scratch +- Focus on **improving existing code** + + + +## Resources + +- Python exception handling: + https://docs.python.org/3/tutorial/errors.html + +- PEP8 – Python Style Guide (must read): + https://peps.python.org/pep-0008/ + +- Python Best Practices (read selectively): + https://docs.python-guide.org/writing/style/ + +- Refactoring basics (from live class) +- Your Day 01 / Day 02 scripts + + +## Why This Matters for DevOps + +In real-world DevOps: +- Scripts run in production +- Failures are common (network, permissions, input errors) +- Code is often read and modified by others + +Following PEP8 and best practices makes your automation: +- Easier to debug +- Easier to maintain +- Safer to run in production environments + + +## Submission + +1. Update your existing scripts from `day-01` and `day-02` and update it inside the `day-03` folder +2. Ensure the script runs successfully +3. Commit and push your changes to your fork + + +## Learn in Public + +Share your progress on LinkedIn: +- Post a small code snippet showing improved structure or error handling +- Mention how you applied PEP8 or best practices +- Write 2–3 lines on what you learned today + +Optional: +- Tag **TrainWithShubham** or **Shubham Londhe** +- Use hashtags: `#PythonForDevOps #TrainWithShubham #DevOpsKaJosh` (Helps me to filter post and Like/ Comment / Repost / engage) + + +Happy Learning +[TrainWithShubham](https://www.trainwithshubham.com/)