Practice 1: ATM Withdrawal Issue balance = 1000 withdraw = int(input("Enter withdrawal amount: ")) if withdraw <= balance: balance = balance - withdraw print("Withdrawal successful, remaining balance:", balance) else: print("Insufficient funds") Python Logical Operat...
Given the digits 1, 2, 3, and 4, how many distinct three-digit numbers can be formed without repeating any digit? This is a classic combinatorial problem equivalent to calculating permutations of 4 items taken 3 at a time, denoted as P(4,3) = 4! / (4-3)! = 24. Brute-force Approach with Nested Loops...
Handling dozens of monitoring targets makes manual Prometheus rule updates a bottleneck. An automated pipeline that accepts alert definitions through a REST interface, persists them in a database, and safely pushes generated rule files to Prometheus servers eliminates this pain. Architecture Overvie...
CourseSoftware Engineering FundamentalsAssignment LinkCourse Assignment PortalObjectives1. Understand software development lifecycle2. Enhance coding proficiency3. Master code quality and performance analysis techniques4. Implement unit testing for projects5. Understand test coverage metrics GitHub...
What is Cython? Cython is a compiler that translates Python code into C or C++ code. This allows developers to write Python-like code while achieving the performance benefits of a compiled language. It is not part of the Python standard library and must be installed separately using a package manage...
Bubble Sort A straightforward comparison-based sorting technique that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. def bubble_sort(data): size = len(data) for i in range(size): for j in range(size - i - 1): if data[j] > data[j + 1]:...
Dynamic Notification DispatchingTo build a system that supports multiple notification channels (like SMS, Email, and Push Notifications) and allows quick switching via configuration, we can use dynamic module importing combined with an abstract base class.Create an abstract base class in services/no...
Installing Python To establish a Python development environment on Windows 10, the initial step involves installing Python itself. This process resembles installing any standard software application: downloading the installer from the official Python website and executing it. Visit https://www.pytho...
Iterators Iteration is a way to access elements of a collection. An iterator is an object that remembers the position during traversal. Iterator objects start from the first element of the collection and go until all elements are accessed. Iterators can only move forward, not backward. 1. Iterable O...
FastAPI supports standard RESTful HTTP methods for API design. These methods define operations on resources identified by URIs (Uniform Resource Identifiers). Common HTTP Methods: GET: Retrieve data from the server (Read). POST: Submit data to the server (Create). PUT: Update an existing resource (U...