Python Programming Assignment – Lesson: Loops
📅 Submission Deadline: 16th May 2025
👉 Upload your Python file to GitHub and submit the link in the lesson's "About" section.
Assignment Objective:
Learn to use for loops, while loops, nested loops, and break/continue to repeat tasks,
automate counting, and control the flow of your code.
📘 Instructions:
1. Complete all tasks below in one Python file.
2. Add comments to explain what each part of your code does.
3. Save the file as loops_assignment.py.
4. Upload it to your GitHub and submit the link in the lesson's About section.
✍️ Tasks:
✅ Task 1: Using a for Loop
Print numbers from 1 to 10 using a for loop.
✅ Task 2: Using a while Loop
Print numbers from 1 to 5 using a while loop.
✅ Task 3: Loop with a Condition
Ask the user for a number and use a while loop to count down to 1.
Example:
If input is 5, it should print: 5, 4, 3, 2, 1
✅ Task 4: Nested Loop
Print a mini multiplication table for numbers 1 to 3 like this:
1. 1x1=1
2. 1x2=2
3. 1x3=3
4. ...
5. 3x3=9
✅ Task 5: Using break
Use a loop to print numbers from 0 to 10.
Stop the loop when the number reaches 6 using break.
✅ Task 6: Using continue
Use a loop to print numbers from 0 to 5, but skip number 3 using continue.
🏆 Bonus Task: Count the Letters!
● Ask the user to enter a word.
● Use a for loop to print each letter on a new line.
📤 Submission:
1. Save your file as loops_assignment.py.
2. Upload it to GitHub.
3. Submit the GitHub link in the About section of your lesson before 16th May 2025.