CONDITIONAL Statements in Python (IF, ELIF, ELSE, Nested, Ternary Operators) - Python for Beginners
HTML-код
- Опубликовано: 21 июл 2024
- 🎓 Welcome back to Digital Academy, the Complete Python Development Tutorial for Beginners, which will teach you How to control the execution flow in your program, using Expressions and Conditional Statements in Python: IF, ELIF, ELSE - and more!
▬▬▬▬ 📖 Content ▬▬▬▬
🖥️ Everything you have seen so far, has consisted of sequential execution, in which statements are always performed, one after the next - and exactly in the order you specified, explicitly!
But the World is often more complicated than that. Frequently, a program needs to skip over some statements, execute a series of statements, repetitively - or even choose between alternate sets of statements, to execute. And this is where the core concept of Control Structure comes in, so you can control which instructions are executed, in your program - and alter its behaviour.
In programming languages, most of the time you want to control the execution flow of your program, since: you want to execute some set of statements, only if the given condition is satisfied. And a different set of statements, when it is not satisfied. Please, also note that Conditional Structures are also known as: Decision-making statements!
A Decision, is when a program has more than one choice of actions, depending on a variable's value. In the real World, you commonly must evaluate information around you, and then choose one course of action or another, based on what you observe (e.g traffic light)
Luckily, when your application needs to make such decisions in Python, the IF statement is how you perform this sort of decision-making. And it allows conditional execution of a statement, or a group of statements, based on the value of a boolean expression. Then comes IF, ELSE, and ELIF - so you can add more branches to your program.
🎯How to control the execution flow of your program, so you can change its behaviour based on an expression, or variable's value? In this video, you will discover conditional statements: If, Else, Elif. You will then learn how to combine them in Nested Conditionals, and How to use Ternary Operators!
Let's play this video, stick around and watch until the end! 👍🏻
- Digital Academy™ 🎓
▬▬▬▬ 🎬 Watch NEXT ▬▬▬▬
○ PYTHON OPERATORS: • OPERATORS in Python (A...
○ PYTHON FOR Loops: • FOR Loop in Python (Sy...
○ PYTHON WHILE Loops: • WHILE Loop in Python (...
○ PYTHON LIST: • LISTS in Python (Creat...
🌐 Blog: digital.academy.free.fr/blog/p...
📖 [PLAYLIST] Complete Python Development Course for Beginners: digital.academy.free.fr/playli...
▬▬▬▬ 🔗 Links ▬▬▬▬
🌐 Blog: digital.academy.free.fr/blog
🛒 Shopping: payhip.com/DigitalAcademyOnline
📘 [BOOK] Python for Absolute Beginners: amzn.to/3NvyOWV
👨🏼🏫 [ALL COURSES] digital-academy-online.teacha...
💌 Weekly Newsletter for Developers: www.getrevue.co/profile/digit...
▬▬▬▬ ⏱ Timestamps ▬▬▬▬
00:00 | Intro
00:09 | Introduction
01:08 | Conditional Statements in Python
01:40 | Definition - Control Flow Execution
02:48 | Python Conditional - IF Statement in Python
06:30 | Python Conditional - IF-ELSE Statement in Python
09:00 | Python Conditional - ELSE-IF (ELIF) Statement in Python
11:35 | Nested Conditionals in Python
12:50 | Ternary Operators in Python
14:29 | Conclusion
15:10 | Subscribe, Like, Comment & Share
#Python #Tutorial #Beginners #Conditionals #If #Else #Elif
▬▬▬▬ ⭐ FOLLOW US ▬▬▬▬
✧ digital.academy.free.fr
✧ / digitalacademyy
✧ / digitalacademyfr
✧ / digital_academy_fr
✧ / digitalacademyonline
▬▬▬▬ ⚡ SUPPORT US ▬▬▬▬
✧ digital.academy.free.fr/join
✧ digital.academy.free.fr/donate
✧ digital.academy.free.fr/subscribe
✧ / digital_academy
✧ www.buymeacoffee.com/digital_...
How to control the execution flow of your program, so you can change its behaviour based on an expression, or variable's value? In this video, you will discover conditional statements: IF, ELSE and ELIF. You will then learn how to combine them in Nested Conditionals, and How to use Ternary Operators!
Thanks! 🐍🙏
Thaaanks for supporting 🙏🏻
Hoping this video helped you better understand conditional statements in Python 👍🏻
Plz put videos of data structures and algorithm
Sure, I will cover these basics - too! 👍🏻
ALL Basics in Python for Beginners have been covered into ONE single Tutorial. If you wanna check it out - it’s all yours 😊 Enjoy it and share it if you want 🙈
Content Suggestions
C#
Godot or unity for Game dev
Thanks for your feedback, Richard 🙏🏻 I take good note and may think about it, if many people ask for the same content!
I will consider it, that’s for sure. But I’m still working on my Python training first
🗽
Thanks, again! :) As a Complete Beginner in Python, Did you understand Conditional statements?
@@DigitalAcademyOnline Many thanks as well! In theory everything clear for me but when I finish with theory and will do more exercises and will write my own code, I think I will experience lack of practical skills and understanding.
Yeah, That’s absolutely fine and normal, Alexandr. If you’re good with theory, you just have to practice and keep practicing. Everything will fall into place, eventually
Are you already familiar with algorithm?
i see your post in facebook then visit here
Heeyy! 👋🏻 Thank you for stopping by! 🙏🏻 Hope you did enjoy this video! There is more to come, very soon! 👍🏻
Thaanks, for being an active member of this community! Did you find the videos interesting, or even useful? Have a lovely day!
@@DigitalAcademyOnline yes bro very useful.
ALL Basics in Python for Beginners have been covered into ONE single Tutorial. If you wanna check it out - it’s all yours 😊 Enjoy and share if you want, Muhammad
Please speak urdu
From now and then, I will try to add subtitles - so anyone can enjoy this Python Course for Beginners 👍🏻
@@DigitalAcademyOnline no sir if make toturial on urdu or hindi languages your chanel will promot soon
Insallah
Thaanks, for being an active member of this community! How is your Python learning going? Did you find the videos interesting, or even useful? Have a lovely day!
Digital Academy Thanks for adding title and description in French! Hope you will grow this community, your deserve it 👍🏻
Urdu captions have been added to most of my long videos. Would you help me grow this channel and share it around you? 🤗