Course Content
Programming Foundations Topics:
-Introduction to Python -Installing Python & Setting Up IDE -Variables, Data Types & Operators -Input & Output -Conditional Statements (if, else, elif) -Loops (for, while) -Functions and Parameters -Error Handling (Try/Except)
0/9
Web Development with Python
Topics: Introduction to Flask Introduction to Django Building Your First Web App Routing and Templates Handling Forms Connecting to Databases (SQLite/MySQL) User Authentication Deploying Python Apps Online
Data Science & AI
Topics: Python for Data Analysis Numpy & Pandas Basics Data Cleaning Techniques Data Visualization (Matplotlib, Seaborn) Introduction to Machine Learning (Scikit-Learn) Supervised vs Unsupervised Learning Linear Regression, KNN, and Decision Trees Basic Neural Networks
Automation & Scripting
Topics: Automating Files and Folders Sending Emails with Python Web Scraping (BeautifulSoup, Selenium) Working with Excel & CSV files Scheduling Tasks with Python Scripts PDF and Image Manipulation
Game Development
Topics: Intro to Pygame Creating a Game Window Sprite Movement & Collision Score Tracking Sound and Music in Games Game Projects: Pong, Snake, Flappy Bird
Career & Interview Prep
Topics: Common Python Coding Problems String & List Manipulation Challenges Recursion & Algorithm Practice Big-O Notation Basics Cracking Python Interview Questions Building a Python Portfolio
Advanced Python
Topics: Object-Oriented Programming (OOP) Working with APIs (REST APIs, JSON) Unit Testing with unittest File Handling (Text, JSON, Pickle) Decorators, Generators, and Lambda Functions Multithreading & Asynchronous Programming
Python Full Course

πŸ“ Overview

Loops allow you to repeat actions automatically in Python. Instead of writing the same code again and again, loops help you run blocks of code multiple times until a condition is met.


🎯 What You’ll Learn

  • What loops are and why they’re useful

  • How to use for and while loops

  • How to use break and continue for control

  • Practical examples using both loop types


πŸ”„ 1. What is a Loop?

A loop lets your program repeat a block of code until a condition is met or for a number of times.


πŸ”’ 2. for Loops (Counted Repetition)

Used to loop through a sequence like a list, string, or a range of numbers.

python
for i in range(5):
print("Hello")

πŸ“Œ Output:

nginx
Hello
Hello
Hello
Hello
Hello

πŸ’‘ Looping with range(start, stop, step)

python
for i in range(1, 6):
print(i)

Output:

Β 
1
2
3
4
5

πŸ” 3. while Loops (Conditional Repetition)

A while loop continues as long as a condition is true.

python
count = 1
while count <= 5:
print("Count is:", count)
count += 1

βš™οΈ 4. Loop Control Statements

πŸ”Ή break

Stops the loop completely.

python
for i in range(10):
if i == 5:
break
print(i)

πŸ”Ή continue

Skips the current loop iteration.

python
for i in range(5):
if i == 2:
continue
print(i)

🎯 5. Practice Task

Write a program that:

  • Asks the user for a number n

  • Prints all numbers from 1 to n

python
n = int(input("Enter a number: "))
for i in range(1, n + 1):
print(i)

🧠 Mini Challenge

Print all even numbers between 1 and 20 using a loop.

python
for i in range(1, 21):
if i % 2 == 0:
print(i)

βœ… Summary

  • Use for loops when you know how many times to repeat

  • Use while loops when you loop based on a condition

  • Use break to exit early and continue to skip iterations


⏭️ Next Lesson Preview

β†’ Functions and Parameters in Python