
Module 3 - Running Loops
During this two-week module, we want to make sure you understand two fundamental concepts that are like building blocks in programming: “for” and “while” loops. These are like the basic tools in a programmer’s toolkit. Whether you’re just starting out in coding or already have some experience, getting the hang of these concepts is super important. It’s kind of like learning the ABCs if you’re just beginning, and if you’re more experienced, it’s like honing your skills to be a coding ninja.
So, what are these loops all about? Well, let’s break it down. Think of a loop like a recipe that tells a computer to do something over and over again until a certain condition is met. The “for” loop is like a chef following a recipe with a fixed number of steps. It’s great when you know exactly how many times you want to repeat an action. On the other hand, the “while” loop is more like telling the chef to keep cooking until a specific condition is satisfied. It’s handy when you’re not sure how many times you’ll need to repeat a task.
Now, why should you care about loops? Imagine you’re a chef in a busy kitchen, and you need to chop a bunch of vegetables. Instead of chopping each one individually, you can use a loop to chop them all one by one, saving time and effort. Loops work similarly in programming. They help you automate repetitive tasks, making your code efficient and adaptable. Whether you’re building a simple calculator or a complex video game, loops are your trusty sidekicks, ensuring your code runs smoothly.
Whether you’re a beginner excited to learn or an experienced programmer aiming to level up your skills, these loops are the essential tools you need in your coding arsenal. By the end of this module, you’ll not only know how to use them but also understand why they’re crucial for writing effective, efficient, and flexible code. So, let’s dive in and explore the world of loops – your key to unlocking the full potential of programming!
Over the next two weeks, here’s what you’ll be doing:
- You’ll learn the basics of repetition structures, specifically focusing on for and while loops.
- You’ll dive deeper into programming by using nested “if” statements with loops.
- You’ll complete and submit Notebook 3 as part of your assignments.
- You’ll continue to use AI assistance for programming tasks with ChatGPT.
W3 Schools
https://www.w3schools.com/python/python_while_loops.asp
https://www.w3schools.com/python/python_for_loops.asp
Recommended YouTube Videos
Corey Schafer – Python Tutorial for Beginners 7: Loops and Iterations
Khan Academy – While Loops in Python
Python Programming – Python While Loop Accumulator
Create a Notebook Chapter on Repetition Structures
Chapter Title: Repetition Structures
1. What is a repetition structure?
Briefly explain what both for and while loops and its applications.
Mention why it is useful in programming.
Show how you can use them with if statements.
2. How do you calculate a running total?
Show an example of using a running total.
When would you use it?
How would you write it?
This is also called “cumulative sum”
3. What is an “Augmented Assignment Operator”?
Use the simplified code to write cleaner code.
What are the different operators and how would you write them?
4. How do you format outputs with f strings (,.2f)?
What is an f string?
What are the different formatting options?
How do you add decimals and commas to formatting?
How do you control the width of a value field?
How do you specify zero padding?
5. What is a nested loop used for?
When would you use a nested loop?
Write the code for using a nested loop?
Chapter Summary
Summarize the key concepts covered in the chapter.
Encourage students to practice writing code and experimenting with concepts.
Assignment Instructions
- In your notebook, create a well-organized chapter following the structure provided.
- Include explanations, examples, and where appropriate, screenshots.
- Feel free to add personal insights or observations.
Turn in Your Assignment
MMIS 6391 – After you finish creating your textbook chapter, save it as a PDF and upload the PDF to GeorgiaView.
CBIS 4210 – You will need to login to the OneNote “class” that was created for you. Create pages in Section 1 and add content into the OneNote.
Creating a PyCharm Video Tutorial for Repetition Structures
Assignment Description
For this task, you are to produce a step-by-step video guide that demonstrates the use of repetition structures, focusing on ‘for’ and ‘while’ loops. in building a rudimentary Python application. You’ll employ the PyCharm IDE for project development and management. The objective of this assignment is twofold: to deepen your understanding of how to implement repetition structures for looping tasks within your application and to refine your ability to convey complex information through a well-crafted video tutorial.
Objective
The main objectives of this assignment are:
- Gain a comprehensive understanding of how to use repetition structures, with a particular focus on ‘for’ and ‘while’ loops in Python programming.
- Continue to familiarize yourself with using PyCharm IDE for creating and managing a Python project.
- Learn the importance and implementation of repetition structures within a Python application.
Instructions
Topic Selection
Select a straightforward collection of applications to feature in your tutorial. Your examples should demonstrate the use of both for and while loops. Additionally, I want you to use if statements from Module 2 to make your application more complex and to continue to build on our programming skills.
Video Tutorial Creation
- Coding Walkthrough: Create a step-by-step video tutorial demonstrating the process of using proper for and while loops with if statements.
Clarity and Communication
- Use clear and concise language to explain each step of the setup and coding process.
- Ensure that your instructions are easy to follow and suitable for an audience unfamiliar with PyCharm.
- Include visual aids like annotations, highlighting, and cursor tracking to guide viewers’ attention.
Video Format and Length
- The video should be between 7 to 10 minutes in length.
- Use screen recording software to capture your coding process.
- You can use video editing software to enhance the clarity and quality of the tutorial.
Submission
After you create your video upload it to your YouTube channel that comes with your school email address. You can set your video to unlisted, but be sure to make sure it can be viewed. Be sure to write a brief description of your video in the YouTube video description.
Upload your YouTube video link to the comment section of this assignment.
Include a copy of your .py file in GeorgiaView.
Prepare for an in-class quiz where you’ll be tasked with building a functional application that uses repetition structures and decision structures. Ensure you’re equipped with the skills to gather user input, establish variables, perform calculations, and generate output using f-strings.