Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

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

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