Python Branches - If Else Statements Tutorial with Example - APPFICIAL
You make decisions everyday, such as what to wear, what to eat, whether to go to school or work, or even to watch this video. You can make similar decisions in your python code using branching.
In programming a branch is computer code that is only executed if a condition is true. For example, if the date is Friday, then run the code to send out weekly paychecks to employees.
To create a branch, you first specify an if statement followed by a boolean expression, or condition that can only be true or false. If the condition is true, the branch executes the indented statements that follow. If the condition is false, you can have an else branch to execute different indented statements.
For example:
if age == 0:
print(’You are a baby’)
else:
print(‘You are not a baby ’)
A code block is a series of statements that are grouped together. Be sure to properly indent all code belonging to an if statement or an else statement, so python knows which code block belongs to it. Indentations are typically done by one tab, or 3-4 spaces. You should not mix up spaces and tabs for indentation in your program, or it may lead to errors.
A nested if-else is when you have an if-else branch within another if or else
Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python Branches - If Else Statements Tutorial with Example - APPFICIAL», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.