An In-Depth Guide to For and While Loops in Python