WHILE Loop in Python (Syntax, Break, Continue, Else, Infinite Loops) - Python Tutorial for Beginners

preview_player
Показать описание
🎓 Welcome back to Digital Academy, the Complete Python Development Tutorial for Beginners, which will help you repeat a block of code in Python - indefinitely - or until some condition is met, using WHILE Loops in Python - plus 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 in Python, and will be discussed in the next section.

○ Definite iteration: In which the number of repetitions is specified, explicitly and in advance. This kind of iteration is performed using FOR Loops in Python, and has been discussed in the previous video.

WHILE Loops in Python are traditionally used when you have a block of code which you want to repeat, until some condition is met. 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 in Python. 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 (infinite) WHILE Loops. Then, you will learn how you can alter the execution of an iteration, with: BREAK, CONTINUE and ELSE statements in Python.

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

- Digital Academy™ 🎓

▬▬▬▬ 🎬 Watch NEXT ▬▬▬▬

▬▬▬▬ 🔗 Links ▬▬▬▬

▬▬▬▬ ⏱ Timestamps ▬▬▬▬

00:00 | Intro
00:09 | Introduction
01:05 | Python Loops
01:58 | Python WHILE Loops
02:52 | Python WHILE - Syntax
03:44 | Python WHILE - Examples
06:09 | Python WHILE - BREAK in Python
08:37 | Python WHILE - CONTINUE in Python
09:56 | Python WHILE - ELSE in Python
11:36 | Python WHILE - Infinite Loop in Python
13:08 | Conclusion
13:58 | Subscribe, Like, Comment & Share

#Python #Tutorial #Beginners #While #Loops

▬▬▬▬ ⭐ FOLLOW US ▬▬▬▬

▬▬▬▬ ⚡ SUPPORT US ▬▬▬▬

Рекомендации по теме
Комментарии
Автор

🎯In this video, you will discover multiple ways to control the execution flow of your program, using WHILE Loops. Then, you will learn how you can alter the execution of an iteration, with: BREAK, CONTINUE and ELSE statements. Did you like this video? Please, Like, Comment & Share :)

DigitalAcademyOnline
Автор

Wow, that’s a great video for anyone who is interested in learning Python, with all the Basics for Beginners! 👍🏻

xJrmy
Автор

Helpful information, but the audio is little disruptive for me. Maybe lower the volume of it a little. I appreciate your content!

girlwhytho
Автор

What is "=/=" that is on the "while" line? I can't find that anywhere on Google.

SandyRowles
Автор

Great content! I subscribe, thanks a lot for theses lessons. I stay tuned! Cyril

cyrilbrandt
Автор

Very helpful for beginners. Keep going. 👏👏👏

harshithaamurali