Posts

Showing posts from January, 2026

Python Automation for DevOps 🔥 | If Else, For Loop, While Loop Explained

Image
 As a DevOps engineer , automation is part of our daily work. Tools like Python help us automate tasks, manage systems, and write scripts efficiently. Today, I’m going to explain Conditions, Loops, and Import in Python in a very simple and practical way . What is a Condition in Python? A condition means checking something as True or False . Example: i < 3 Explanation: i → variable < → condition operator 3 → value In simple words: 👉 Check if i is less than 3 Example: Simple Calculator Using Conditions Now, open VS Code and write the following code: num1 = float(input( "Enter num 1: " )) # Taking first number num2 = float(input( "Enter num 2: " )) # Taking second number opr = input( "Enter operator (+, -, *): " ) output = None # Default value if opr == "+": output = num1 + num2 elif opr == "-": output = num1 - num2 elif opr == "*": output = num1 * num2 print("Your calculation is:", o...