Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/faizan35/python_for_devops

Learning Python for DevOps: A comprehensive repository providing hands-on exercises and projects to master Python programming in the context of DevOps practices.
https://github.com/faizan35/python_for_devops

Last synced: about 1 month ago
JSON representation

Learning Python for DevOps: A comprehensive repository providing hands-on exercises and projects to master Python programming in the context of DevOps practices.

Awesome Lists containing this project

README

        

# Python For DevOps

Welcome to the "Learning Python for DevOps" repository! This repository is designed to guide you through the process of learning Python and applying it to various DevOps practices. Whether you are a beginner or have some experience, this resource aims to provide you with practical exercises and projects to strengthen your Python skills in the context of DevOps.

## Table of Contents

Here's a day-wise Python learning syllabus with daily exercises to help you get started:

### **Week 1: Python Basics**

#### **Day 1: Introduction to Python**

- **Topics**: What is Python? Installation, Python IDEs, Basic Syntax
- **Exercises**:
1. Install Python and set up an IDE (VSCode, PyCharm, etc.).
2. Write a simple Python program to print "Hello, World!".

#### **Day 2: Variables and Data Types**

- **Topics**: Variables, Data Types (int, float, str, bool), Type Casting
- **Exercises**:
1. Create variables of different data types.
2. Write a program to input two numbers from the user and display their sum.

#### **Day 3: Basic Operators**

- **Topics**: Arithmetic Operators, Assignment Operators, Comparison Operators, Logical Operators
- **Exercises**:
1. Write a program to calculate the area of a rectangle.
2. Create a program that takes two numbers and prints the result of all basic arithmetic operations.

#### **Day 4: String Manipulations**

- **Topics**: String Slicing, String Methods, String Formatting
- **Exercises**:
1. Write a program to reverse a string.
2. Create a program that converts a given string to uppercase.

#### **Day 5: Lists and Tuples**

- **Topics**: Lists, Tuples, Indexing, Slicing, List Methods, Tuple Methods
- **Exercises**:
1. Create a list of 5 fruits and display them.
2. Write a program to find the largest number in a list.

#### **Day 6: Dictionaries and Sets**

- **Topics**: Dictionaries, Sets, Dictionary Methods, Set Methods
- **Exercises**:
1. Create a dictionary with 5 key-value pairs and print all the keys.
2. Write a program to find the intersection of two sets.

#### **Day 7: Review and Practice**

- **Topics**: Review all topics covered in Week 1
- **Exercises**:
1. Create a small program using lists, dictionaries, and string manipulations.
2. Complete any pending exercises from the week.

### **Week 2: Control Structures and Functions**

#### **Day 8: Conditional Statements**

- **Topics**: if, elif, else Statements
- **Exercises**:
1. Write a program to check if a number is positive, negative, or zero.
2. Create a program that takes a user's age and determines if they are a minor, an adult, or a senior citizen.

#### **Day 9: Loops**

- **Topics**: for Loop, while Loop, Loop Control Statements (break, continue, pass)
- **Exercises**:
1. Write a program to print the first 10 natural numbers using a for loop.
2. Create a program that calculates the factorial of a number using a while loop.

#### **Day 10: Functions**

- **Topics**: Defining Functions, Calling Functions, Parameters, Return Statement
- **Exercises**:
1. Write a function to calculate the square of a number.
2. Create a function that takes a list of numbers and returns the sum of the numbers.

#### **Day 11: More on Functions**

- **Topics**: Lambda Functions, \*args, \*\*kwargs, Recursion
- **Exercises**:
1. Write a lambda function to find the maximum of two numbers.
2. Create a recursive function to compute the Fibonacci sequence.

#### **Day 12: Error Handling**

- **Topics**: Try, Except, Finally, Raising Exceptions
- **Exercises**:
1. Write a program that takes a number from the user and handles the exception if the input is not a number.
2. Create a program to handle file not found exceptions.

#### **Day 13: Modules and Packages**

- **Topics**: Importing Modules, Creating Modules, Python Standard Library
- **Exercises**:
1. Write a program to import the math module and calculate the square root of a number.
2. Create a custom module and use it in a program.

#### **Day 14: Review and Practice**

- **Topics**: Review all topics covered in Week 2
- **Exercises**:
1. Write a program that utilizes conditional statements, loops, and functions.
2. Complete any pending exercises from the week.

### **Week 3: Advanced Python Concepts**

#### **Day 15: File Handling**

- **Topics**: Reading Files, Writing Files, Working with CSV Files
- **Exercises**:
1. Write a program to read a text file and count the number of words.
2. Create a program that writes user input to a file.

#### **Day 16: Object-Oriented Programming (OOP) - Part 1**

- **Topics**: Classes and Objects, Constructors, Instance Variables
- **Exercises**:
1. Create a class `Person` with attributes `name` and `age`. Create an object and display its attributes.
2. Write a program to implement a simple calculator using classes.

#### **Day 17: Object-Oriented Programming (OOP) - Part 2**

- **Topics**: Inheritance, Polymorphism, Encapsulation
- **Exercises**:
1. Create a class `Animal` and extend it to a class `Dog`. Add a method `speak` in both classes.
2. Write a program that demonstrates method overriding.

#### **Day 18: Python Libraries Overview**

- **Topics**: Overview of Popular Libraries (NumPy, Pandas, Matplotlib)
- **Exercises**:
1. Install NumPy and create a simple array.
2. Install Pandas and read a CSV file.

#### **Day 19: Introduction to Data Structures**

- **Topics**: Stacks, Queues, Linked Lists (using Python lists and deque)
- **Exercises**:
1. Write a program to implement a stack using a list.
2. Create a queue using the `collections.deque` module.

#### **Day 20: Introduction to Algorithms**

- **Topics**: Basic Sorting Algorithms (Bubble Sort, Selection Sort), Searching Algorithms (Linear Search, Binary Search)
- **Exercises**:
1. Implement Bubble Sort and Selection Sort.
2. Write a program to perform binary search on a sorted list.

#### **Day 21: Review and Practice**

- **Topics**: Review all topics covered in Week 3
- **Exercises**:
1. Create a project that integrates file handling, OOP, and basic algorithms.
2. Complete any pending exercises from the week.

### **Week 4: Advanced Topics and Final Project**

#### **Day 22: Introduction to Web Scraping**

- **Topics**: Web Scraping with BeautifulSoup and Requests
- **Exercises**:
1. Write a program to scrape the headlines from a news website.
2. Scrape and save data from a table on a webpage to a CSV file.

#### **Day 23: Introduction to Database Handling**

- **Topics**: Working with SQLite, CRUD Operations
- **Exercises**:
1. Write a program to create a SQLite database and a table.
2. Perform insert, update, delete, and select operations on the database.

#### **Day 24: Introduction to GUI Programming**

- **Topics**: GUI Programming with Tkinter
- **Exercises**:
1. Create a simple calculator using Tkinter.
2. Develop a basic to-do list application with add and delete functionality.

#### **Day 25: Introduction to APIs**

- **Topics**: Understanding APIs, Making API Requests with Python
- **Exercises**:
1. Write a program to fetch weather data from an API.
2. Create a program to send a request to a public API and display the response.

#### **Day 26: Introduction to Unit Testing**

- **Topics**: Writing Unit Tests with `unittest` Framework
- **Exercises**:
1. Write unit tests for basic functions.
2. Create tests for a class that handles basic arithmetic operations.

#### **Day 27: Final Project Planning**

- **Topics**: Final Project Planning and Design
- **Exercises**:
1. Plan a final project that integrates multiple concepts learned (e.g., a web scraper that stores data in a database and has a GUI).
2. Outline the requirements and design of the project.

#### **Day 28: Final Project Implementation**

- **Topics**: Final Project Development
- **Exercises**:
1. Implement the final project.
2. Test and debug the project, ensuring all requirements are met.

---

## How to Use This Repository

- Each module contains theoretical content and practical exercises.
- Follow the exercises to reinforce your understanding of Python for DevOps.
- The `code` directory contains code snippets and scripts related to each module.

## Getting Started

1. Clone this repository:

```bash
git clone
cd
```

2. Set up a virtual environment:

```bash
python -m venv venv
source venv/bin/activate # On Linux: source venv/bin/activate
```

3. Install dependencies:

```bash
pip install -r requirements.txt
```

4. Start learning and coding! Navigate to each module's directory to access the relevant content.

## Contributing

**Contributions are welcome!** If you find an issue or have suggestions for improvement, please open an issue or submit a pull request.

## Code of Conduct

Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms.

## License

This project is licensed under the [MIT License](LICENSE).

Happy coding and enjoy your journey into Python for DevOps!