RUVIDEO
Поделитесь видео 🙏

Simple Python Tutorial to compare if and while #if #while #python #simple

Please like the video if it helps you :)

Simple python example and short video to illustrate similarity and differences between "if" and "while". It uses very simple example to focus on how the 2 differs. It first show how to do some user input checking with "if" statement and explain why
it is unable to ensure user has entered a valid input (int in this case). It then went on to explain how we can just change
the "if" to "while" to solve the problem. It shows that "while" works similarly with an "if" statement where there is a
test condition to decide whether to execute the statements within the body. The only difference if that "if" statement
only perform the test condition check once but "while" will perform it repeatedly until the test condition become False.
Thus a "while" can be seen as a "repeated if" statement running.

Beginners tends to confuse "if" and "while" and tends to use "if" when a "while" is more relevant.
The syntax for both are largely similar and the the way it control the flow of the code as well.
This short video hopes to highlight the differences so that it is clearer when they should be used.

== Syntax of "if" ==
if(test condition):
indent == 1st statement of Body statement
indent == ...
indent == last statement of Body statement

== Syntax of "while" ==
while(test condition):
indent == 1st statement of Body statement
indent == ...
indent == last statement of Body statement

You can use the link below to see some related videos
(Apart from watching the video, you can also show more info to read on the explanation.)
== how "while" loop works works ==
https://youtu.be/Eiu4vkIkAdk

== More on how "for" loop works ==
https://youtu.be/AoGuZqTQerE

== More on how range() works ==
https://youtu.be/nkLbrJuqumI

Hope these inputs are helpful for you.

0:00 - "if" only checks condition once but we need to repeat checking
02:10 - "while" works like "repeat" "if" command
02:37 - replace "if" with "while" to make it work

Keywords:
#python
#if
#decision
#while
#loop
#condition
#conditional
#repeat
#differences
#short
#simple
#easy
#beginner
#tutorial
#basic

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Simple Python Tutorial to compare if and while #if #while #python #simple», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.