FOR Loop in Python (Syntax, Break, Continue, Else, Nested Loop, Range, Index) - Python for Beginners

Publicado el: 17 abril 2020
en el canal de: Digital Academy
10,320
229

🎓 Welcome back to Digital Academy, the Complete Python Development Tutorial for Beginners, which will help you repeat a block of code for a fixed number of times, using FOR Loops in Python - and alter its behaviour with CONTINUE, BREAK and ELSE keywords in Python!

▬▬▬▬ 📖 Content ▬▬▬▬

🖥️ Loops in Python are an efficient method for optimising your code, and executing multiple statements. If the same block of code has to be executed, multiple times, over and over: you can put it into a Loop, to perform multiple iterations. Consequently: it saves a lot of effort, and reduces complexity of your Python code, as well.

Basically, there are two types of Loops, in programming languages:

○ Indefinite iteration: In which the code block executes, until some condition is met. This iteration is performed using WHILE Loops, and will be discussed in the very next upcoming video.

○ Definite iteration: In which the number of repetitions is specified, explicitly and in advance. This kind of iteration is performed using FOR Loops, and will be discussed in this video.

FOR Loops in Python are traditionally used when you have a block of code which you want to repeat, a fixed number of times. It iterates over the members of a sequence (strings, dictionaries, lists, tuples and sets - or any other iterable objects), then executes the same block of code, each time - and in order.

You can also alter the behaviour of the current iteration inside the Loop, using BREAK and CONTINUE statements .Then execute a block of code when the Loop terminates naturally, or reaches the last item of a sequence.

🎯 In this video, you will discover multiple way to control the execution flow of your program, using FOR Loops in Python. Then, you will learn how you can alter the execution of an iteration, with: BREAK, CONTINUE and ELSE statements in Python.

Finally, you will discover the function range() in Python: to generate a sequence of numbers and execute a block of code, a fixed number of times. It can be combined with the len() function, to iterate through a sequence using indexing. This way, you can get the index of the current item, in the list (enumerate)

Let's play this video, stick around and watch until the end! 👍🏻

Digital Academy™ 🎓


▬▬▬▬ 🎬 Watch NEXT ▬▬▬▬

○ PYTHON OPERATORS:    • OPERATORS in Python (Arithmetic, Assi...  
○ PYTHON CONDITIONALS:    • CONDITIONAL Statements in Python (IF,...  
○ PYTHON WHILE Loops:    • WHILE Loop in Python (Syntax, Break, ...  
○ PYTHON LIST:    • LISTS in Python (Create, Add, Access,...  

🌐 Blog: http://digital.academy.free.fr/blog/p...

📖 [PLAYLIST] Complete Python Development Course for Beginners: http://digital.academy.free.fr/playli...


▬▬▬▬ 🔗 Links ▬▬▬▬

🌐 Blog: http://digital.academy.free.fr/blog

🛒 Shopping: https://payhip.com/DigitalAcademyOnline

📘 [BOOK] Python for Absolute Beginners: https://amzn.to/3NvyOWV

👨🏼‍🏫 [ALL COURSES] http://digital.academy.free.fr/courses

💌 Weekly Newsletter for Developers: https://www.getrevue.co/profile/digit...


▬▬▬▬ ⏱ Timestamps ▬▬▬▬

00:00 | Intro
00:09 | Introduction
01:05 | Python Loops
01:58 | Python FOR Loops
02:40 | Python FOR - Syntax
03:44 | Python FOR - Examples
05:20 | Python FOR - BREAK in Python
07:35 | Python FOR - CONTINUE in Python
08:51 | Python FOR - ELSE in Python
10:15 | Python FOR - Nested Loops in Python
10:44 | Python FOR - range() function in Python
13:04 | Python FOR - enumerate() function in Python
13:50 | Conclusion
14:23 | Subscribe, Like, Comment & Share

#Python #Tutorial #Beginners #For #Loops


▬▬▬▬ ⭐ FOLLOW US ▬▬▬▬

✧ http://digital.academy.free.fr
✧   / digitalacademyy  
✧   / digitalacademyfr  
✧   / digital_academy_fr  
✧    / digitalacademyonline  


▬▬▬▬ ⚡ SUPPORT US ▬▬▬▬

✧ http://digital.academy.free.fr/join
✧ http://digital.academy.free.fr/donate
✧ http://digital.academy.free.fr/subscribe
✧   / digital_academy  
✧ https://www.buymeacoffee.com/digital_...


En esta página del sitio puede ver el video en línea FOR Loop in Python (Syntax, Break, Continue, Else, Nested Loop, Range, Index) - Python for Beginners de Duración hora minuto segunda en buena calidad , que subió el usuario Digital Academy 17 abril 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 10,320 veces y le gustó 229 a los espectadores. Disfruta viendo!