We may earn an affiliate commission when you visit our partners.
Course image
Estefania Cassingena Navone

Learn how to use the power of for Loops, while Loops, nested loops (and more. ) in Python. Build 4 projects, understand how loops work behind the scenes, and practice with coding exercises.

Read more

Learn how to use the power of for Loops, while Loops, nested loops (and more. ) in Python. Build 4 projects, understand how loops work behind the scenes, and practice with coding exercises.

Take your Python skills to the next level by mastering loops and looping techniques.

  • Learn how for Loops and while Loops work behind the scenes with step-by-step graphical explanations.

  • Use the power of built-in Python functions such as range(), enumerate(), zip(), sorted(), and reversed() to make your loops more powerful, more concise and more readable.

  • Understand how nested for loops and nested while loops work and learn how to use them in practical scenarios.

  • Customize the functionality of your loops with break and continue. Learn how they work and when to use them.

  • Iterate over strings, lists, tuples, dictionaries, and sets.

  • Detect infinite loops, find their cause, stop them and fix them.

  • Write clearer and more concise Python code.

Student Reviews

- "This course in awesome, it makes me understand the power of loops and how it benefit us in programming." - Surya Teja.

- "Great course. Most python courses do not cover loops in depth. Having an in depth understanding of loops is quite essential as loops are a crucial aspect of programming." - Dee.

- "My sincere thanks go out to the instructor. For more than five years I have been trying to learn Python, but I am not satisfied with my learning method. After taking this course, I understood how to learn the programming and execute the code in a beginner's manner. I would recommend this course not only for professionals, but even for school kids who want to learn how Python syntax and code work together to build a program. Ultimately, I found a course that suited my learning style and helped me understand the concept. In a simplified manner, she will help you clear up any doubts you may have." - Durga.

- "I love this course, the instructor has a way to make these serious materials feels fresh and fun."- Ivan Juniardi.

Course Updates

August 2023 - UPDATE. Section 21 now has intermediate and advanced coding exercises.

May 2023 - NEW. Updated video lectures with a renewed style and a new code editor (Visual Studio Code).

May 2023 - NEW. Updated section overview videos

May 2023 - NEW. Updated lecture and section names

May 2023 - NEW. Improved assignments

May 2023 - NEW. Discussion topics for each section

May 2023 - NEW. Redesigned first and last sections

May 2023 - NEW. Improved and expanded quizzes

April 2023 - NEW. Updated articles with new format.

Nov 2021 - NEW. Updated quizzes with detailed explanations for each answer.

Oct 2021 - NEW. Downloadable Python files for the course exercises.

Enhance your resume with new Python skills.

Python is a very popular programming language that is used for a variety of real-world applications, including web development, data science, machine learning, and artificial intelligence. Learning Python loops and looping techniques is a great way to advance your skills in computer science. Loops are essential tools for any programmer, and they can be used to write powerful and efficient programs.

You will definitely use loops in any field, including:

  • Web Development

  • Machine Learning

  • Data Science

  • Artificial Intelligence

  • Game Development

  • Mobile App Development

  • Bioinformatics

  • Medical Software

  • Computer Vision

  • and... many more.

Loops are also essential to implement data structures and algorithms. If you are thinking about entering any of these fields or if you are planning to expand your computer science skills, then this course is for you.

Any piece of software that you can possibly imagine has repetitive processes that are implemented using loops. The concepts and techniques that you will learn in this course are easily transferable to other programming languages like Java, JavaScript, and many more.

Goals

By the end of this course, you will be able to:

  • Work with for loops and while loops in your programs.

  • Understand how they work.

  • Read loops written by other developers and understand their purpose.

  • Write nested loops and determine when to use them to approach tasks.

  • Use the break and continue statements to stop loops when certain conditions are met.

  • Use built-in Python functions in your for loops to write cleaner code, remove unnecessary variables, and make your code more concise.

Projects

You will work on 4 projects:

  • Draw a Pattern: you will use Python's built-in turtle module to draw patterns using for loops. We will start by drawing simple patterns and then gradually increase their complexity. You will be able to customize this project and experiment with the principles of for loops.

  • Caesar Cipher: you will implement this basic encryption algorithm using a for loop. When the project is completed, you will be able to encrypt and decrypt secret messages (like Julius Caesar did. ).

  • Guess the Number: you will use a while loop and the binary search algorithm to implement a text-based guessing game. The user will select a number between 1 and 100, and the computer will try to guess the number by repeatedly halving the range of possible numbers. The binary search algorithm is explained in detail during the course.

  • Analyze Book Passages: you will use nested loops to read and analyze the content of a book passage in a text file. The program will display the frequency of each letter and the letter with the maximum frequency.

As you can see, you will have many opportunities to apply your knowledge in a wide range of areas during the course.

You will also acquire additional skills such as: problem solving, computational thinking, file handling in Python, knowledge of the Binary Search algorithm and the turtle module. All while learning how to work with loops.

Learning Material & Resources

Throughout the course, you will find these resources:

  • Video Lectures: 10+ hours of video lectures with carefully designed graphics, tables, and code visualizations. You will see how the code works behind the scenes with step-by-step explanations.

  • Projects: build 4 projects and apply your skills in practical scenarios.

  • Coding Exercises: practice with 40+ interactive coding exercises with their corresponding solutions. You will be able to check your solution immediately with the automated grader.

  • Quizzes: check your knowledge with 30+ quizzes with 120+ questions that provide unlimited attempts and instant feedback.

  • Course Exam: take a final exam to test your knowledge of everything you learned during the course. The exam consists of 25+ questions and you can take it as many times as you like. You will receive detailed results for each attempt, so you can track your progress and identify areas where you need to improve.

  • Study Guide: review for the course exam with a detailed study guide with 100+ questions.

  • Articles: read 80+ articles with detailed explanations and illustrations.

What makes this course unique?

This course is unique in its focus on providing visual and detailed explanations of how each type of loop works in Python. You will not only learn how to use loops, but you will also understand the purpose of each line of code. This will give you a deeper understanding of how loops work and how they can be used to solve problems.

The course comes with a variety of study materials that complement the course experience. These resources include a study guide specifically designed for the course, which includes over 100 questions on the course content.

You will be able to solve coding exercises directly on the browser and you will receive instant feedback for your submission.

You will check your knowledge with quizzes that provide instant feedback and questions that will make you think more deeply about the topics presented in each section.

You will receive a certificate of completion that you can add to your resume and social media profiles to showcase your new skills.

You will also have lifetime access to the course.

You are very welcome to watch the preview lectures and check out the full course curriculum.

If you are looking for an engaging, visual, and practical course, then you found it.

Enroll now, add "Python Loops and Looping Techniques" to your resume, and showcase your new skills.

Enroll now

What's inside

Learning objectives

  • Understand the differences between for loops and while loops in python.
  • Choose the right type of loop and looping technique for a given scenario.
  • Write for loops and while loops that are efficient and easy to read.
  • Use for loops to iterate over strings, lists, tuples, dictionaries, sets, and file objects.
  • Use built-in functions such as range(), enumerate(), zip(), sorted(), and reversed() to write for loops.
  • Understand the purpose of the break and continue statements and how they control the flow of execution of a loop.
  • Understand and write nested for loops and nested while loops.
  • Identify and fix infinite loops in python.

Syllabus

Welcome to the Course: Python Loops and Looping Techniques
Welcome to the Course - Course Overview
Welcome to the Course - Important Course Information
Read more
Introduce Yourself and Share your Goals
Iterables in Python: Strings, Lists, Tuples, Dictionaries, and Sets
Welcome to this Section - Iterables in Python
About this Section
  • Concept of iterable.

  • What is considered a "member" of an iterable.

  • Types of iterables in Python.

Iterables in Python

Use of the terms "element" and "item" during the course.

Quick review of boolean operators and functions.

  • Introduction to Strings.

  • Characteristics.

  • How to access individual characters using indices.

  • Strings are Immutable.

How to take a portion of a string using a combination of three parameters: start, end, and step.

In this lecture, you will learn the most commonly used and helpful string methods in Python.

  • Why we will use the interactive shell for the coding sessions of this section.

  • How to write the statements in a Python file and see the output using print().

An interactive coding session with practical examples of the use of strings.

How to concatenate strings using the "plus" operator.

Strings: Concept and Syntax
Strings in Python
  • How to work with lists in Python.

  • How to define a list.

  • How to use indices to access their elements.

  • The basic characteristics of lists.

  • How to add, remove, and find elements in a list.

Lists: Concepts and Syntax

How to slice lists using different combinations of the parameters start, end, and step.

An interactive coding session with practical examples of the use of lists.

A detailed description of the most commonly used and helpful list methods.

A graphical explanation of nested lists.

Lists: Practice
Lists in Python
  • How to work with tuples in Python.

  • The main characteristics of tuples.

  • How immutability changes the functionality of tuples.

  • How to find the number of occurrences of a value in a tuple.

Tuples: Concept and Syntax

The key functional difference between lists and tuples.

An interactive coding session with practical examples of the use of tuples.

A practical explanation of nested tuples.

Tuples in Python
  • How to work with dictionaries in Python.

  • The elements of dictionaries: key-value pairs.

  • The characteristics of keys and values.

  • How to access, add, remove, and modify a key-value pair to a dictionary.

A detailed description with examples of the most commonly used dictionary methods.

An interactive coding session with practical examples of the use of dictionaries.

A practical explanation of nested dictionaries.

Dictionaries: Concepts and Practice
Dictionaries in Python
  • How to work with Sets in Python.

  • The characteristics of Sets.

  • How to create an empty set.

  • How to add and remove elements from a set.

An interactive coding session with practical examples of the use of sets.

The difference between a set and a frozenset.

Sets: Concept and Practice

A link to a helpful complementary article on Sets and their operations.

Sets in Python
Discussion Topic: Share your Thoughts
for Loops in Python
Welcome to this Section - for Loops in Python
What is a Loop?

What the term "iteration" means and why it is closely connected to loops.

  • The purpose and use cases of For Loops.

  • When and why you should use them.

  • How For Loops work behind the scenes.

  • A graphical explanation using a flowchart to explain the logic behind For Loops.

The general syntax used to write for loops in Python.

A practical coding session showing how to write a For Loop.

How to use indentation properly, following the official style guide of the Python language.

Your First for Loop in Python

Detailed explanation of the role of the loop variable in for loops.

Section Quiz: for Loops Basics

How to draw a spiral pattern using the turtle module.

for Loops and range()
Welcome to this Section - for Loops in range()
  • Purpose and functionality of the range function.

  • How range works behind the scenes in a for loop.

  • The three parameters that you can use to customize the sequence of integers returned by range.

Why you should use the built-in range() function over lists and tuples to customize the functionality of For Loops.

range() in Python

How to see the sequence returned by range.

A practical coding session with examples of the use of range with one parameter.

range() With One Parameter
  • The meaning and purpose of the start and end parameters in range.

  • The default value of the step parameter.

  • How to customize the sequence of integers returned by range with these two parameters.

A practical coding session with examples of the use of range with two parameters.

range() With Two Parameters in Python
  • The purpose of the step parameter.

  • How to customize the step in the sequence of integers returned by the range function.

A practical coding session with examples of the use of range with three parameters.

A summary of the key aspects of the three parameters of range and their default values.

range() With Three Parameters in Python

How to work with range and different combinations of negative arguments to generate sequences of integers.

Examples of the use of range with negative parameters.

range() With Negative Parameters in Python

How range objects are tested for equality.

A link to the official documentation of the built-in function range.

Section Quiz: for Loops and range()
Practical Section: For Loops and the range() Function
Counting Vowels
Print a Pattern: Asterisks and Dashes
Generating a Sequence of Numbers
Project: Draw Patterns with for Loops and range()
Welcome to this Project - Draw Patterns Using for Loops and range()
  • Introduction to the turtle module.

  • How to import the module.

  • How the coordinate system works.

  • How to call functions from the turtle module.

  • How to customize the aspect and speed of the pen.

  • Basics of the 2D coordinate system used in the turtle module.

  • Basics of angles and rotations.

  • How to move the turtle (pen) to draw a pattern.

  • How to move forward and backward

  • How to rotate right and left.

  • How to "jump" from one location to another before drawing again.

How to draw basic shapes using the turtle module (a square and a circle).

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Focuses on advanced and widely-used programming basics, loops and looping techniques, a core competency that students will find very useful in many roles and situations
Taught by Estefania Cassingena Navone, instructor who is a professional Python developer with vast expertise in web development, data science, machine learning, and artificial intelligence
Develops skills in working with loops and looping techniques, which are essential for handling repetitive tasks in programming and are required in many different fields of computer science
Takes a practical approach with hands-on labs and interactive coding exercises as part of its methodology, which make it easy for students to engage with the material and test their understanding
Includes a variety of study materials, such as video lectures, exercises, articles, and a detailed study guide, which provide students with multiple modes of learning
Requires learners to have basic programming knowledge and familiarity with Python syntax

Save this course

Save Python Loops and Looping Techniques: Beginner to Advanced to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Python Loops and Looping Techniques: Beginner to Advanced with these activities:
Review basic programming concepts
Reviewing basic programming concepts will help you to strengthen your understanding of loops in Python.
Browse courses on Variables
Show steps
  • Read a tutorial or take a course on basic programming concepts.
  • Complete the practice exercises in the tutorial or course.
Read the textbook
Reading the textbook will help you to reinforce the concepts covered in this course.
Show steps
  • Read the chapters in the textbook that are assigned for this course.
  • Take notes on the important concepts.
  • Complete the practice exercises at the end of each chapter.
Watch tutorial videos
Watching tutorial videos can help you to understand the concepts covered in this course.
Browse courses on Programming
Show steps
  • Find tutorial videos on the topics that you are struggling with.
  • Watch the videos and take notes on the important concepts.
  • Try to apply the concepts that you have learned to your own code.
Five other activities
Expand to see all activities and additional details
Show all eight activities
Join a study group
Joining a study group can help you to learn from your peers and get help with difficult concepts.
Browse courses on Programming
Show steps
  • Find a study group that meets regularly.
  • Attend the study group meetings.
  • Participate in the discussions.
Solve coding exercises
Writing code is a great way to practice using the techniques covered in this course.
Browse courses on While Loops
Show steps
  • Read the problem statement carefully and understand what needs to be done.
  • Translate the problem statement into a series of steps that the computer can understand.
  • Write the code to implement the steps.
  • Test the code to make sure it works correctly.
Attend a Python workshop
Attending a Python workshop can help you to learn new skills and improve your programming abilities.
Browse courses on Programming
Show steps
  • Find a Python workshop that is relevant to your interests.
  • Register for the workshop.
  • Attend the workshop and participate in the activities.
Build a Python project
Working on a project will allow you to apply the skills you have learned in this course to a real-world problem.
Browse courses on Nested Loops
Show steps
  • Identify a problem that you want to solve using Python.
  • Design a solution to the problem.
  • Implement your solution in Python.
  • Test your solution to make sure it works correctly.
Participate in a coding competition
Participating in a coding competition can help you to test your skills and learn from other programmers.
Browse courses on Programming
Show steps
  • Find a coding competition that is relevant to your interests.
  • Register for the competition.
  • Compete in the competition.

Career center

Learners who complete Python Loops and Looping Techniques: Beginner to Advanced will develop knowledge and skills that may be useful to these careers:

Reading list

We haven't picked any books for this reading list yet.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Python Loops and Looping Techniques: Beginner to Advanced.
Python Programming for Beginners: Learn to Code with...
Programming 101: An Introduction to Python for Educators
Python for Beginners: Data Structures
Python Best Practices: Learn to Write Clean Python Code
Python for Beginners: Variables and Strings
Python Programming for Network Engineers: Cisco, Netmiko...
Python Programming Fundamentals
Concepts in Python: Loops, Functions and Returns
Programming in Python
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser