Learn how to get Free YouTube subscribers, views and likes
Get Free YouTube Subscribers, Views and Likes

Learn Python • #6 Loops • How to Repeat Code Execution

Follow
pixegami

Loops in Python will let you run the same code over and over again.

This is useful when working with lists, or if you have something that you want to execute for a certain number of times. In this tutorial, you'll learn why loops are such an important programming concept, and how you can use them in Python.

You'll learn how to loop through every item in a list, or loop for a fixed number of times. You'll also learn how to break early out of a loop, or how to shortcircuit a loop execution to "continue" to the next iteration of a loop.

This video is part of a beginner tutorial series for anyone who wants to learn Python from scratch, and get to a point where you can start coding your own projects.

Project Code (GitHub): https://github.com/pixegami/pythonfo...
Full Playlist:    • Python For Beginners (Full Course)  
Next Chapter: Coming Tomorrow!
Follow me on Twitter: @pixegami

Chapters
00:00 Introduction to Loops in Python
00:40 Using "for" Loops
04:00 Using enumerate()
04:58 Looping X Times ("for in range")
07:13 Using "while Loops
09:00 How to "break" a loop
10:53 How to "continue" a loop
13:17 List Comprehensions
15:00 Coding Exercise: Loops

posted by veros2j