0% found this document useful (0 votes)
4 views3 pages

Python (3)

The Python programming assignment focuses on using various types of loops, including for loops, while loops, and nested loops, to perform specific tasks. Students are required to complete several tasks, such as printing numbers, creating a multiplication table, and implementing break/continue statements. The final submission must be a Python file named loops_assignment.py uploaded to GitHub by the deadline of May 16, 2025.

Uploaded by

riftflixstudios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Python (3)

The Python programming assignment focuses on using various types of loops, including for loops, while loops, and nested loops, to perform specific tasks. Students are required to complete several tasks, such as printing numbers, creating a multiplication table, and implementing break/continue statements. The final submission must be a Python file named loops_assignment.py uploaded to GitHub by the deadline of May 16, 2025.

Uploaded by

riftflixstudios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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.​

You might also like