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

Python Tutorials #B - Conditions

Python Tutorials #B (PT-B) - Conditions
Hope you guys enjoyed the video !
Sorry for the bad transitions inside the video and for the background whistling, I tried to fix it with Audacity, but there was still some sound : I'll try better next time.
Also sorry for the English mistakes I make, I am not very fluent.


Additional information and corrections :
- 1:22 | The string.endswith (sub_string) takes a string as argument and returns True if the string ends with the sub_string entered as argument
- 1:22 | The keyword is a library to import and you can get a list of all the keywords in python by entering keyword.kwlist to get all the keywords in python as strings. You can also use keyword.iskeyword (string) to know if the string you enter as argument is a keyword or not. See GitHub for more examples
- 1:22 | bool (variable) returns the boolean value of a variable : you might ask yourself : Based on which criteria ? Well, for strings, it returns True if the string is not empty (any character in it, including spaces) and False otherwise (so if the string is ' ' or " "). For numbers, if this number is equal to 0, it returns False, else True. You can also use this property in conditions (for instance, if I compute) :
x = 11
if x%2 :
print ('x is odd')
This will print out 'x is odd' as x%2 returns 1, which has a boolean value of True.
For lists and tuples (which we'll see later on), this returns False if the data structure is empty and True otherwise.
- 2:40 | We do know they are not integers from their type (they belong to the floating point numbers class) - but from their value we don't know : type(3.0) != int but 3.0.is_integer() is True as its value can be considered as integer
- 7:25 | '==' is the operator to say if two objects are equal (which is different than representing the same object inside memory). There is a video of Corey Schafer (Youtube channel I highly recommend - excellent Python tutorials, definitely better than mine) on the difference between '==' and 'is' in Python : https://www.youtube.com/watch?v=mO_dS3rXDIs
- 9:01 | 'These will always execute' : they will not always execute, but the code will always go through the 'if' statements whereas the 'elif' depend on the execution of the main 'if' statement or the 'elif' that came before them. If the structure is if, elif, else ; the elif statement will only check its condition if the 'if' statement before was False. Whereas if there are multiple 'if', these will execute independently, without relying on the fact the condition before them is True or False. Hope this made the difference clear for you !
- 16:48 | I don't know if you understood the error I made : I used 'or' instead of 'and' and as one of the conditions was True, it printed out the message saying I was not polite (stupid mistake)

Check out my GitHub Page to get the code used for the video !
https://github.com/PsychoLeo/python/tree/master/youtube

If you have any question or remarks, do not hesitate to leave them in the comments !

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python Tutorials #B - Conditions», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

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

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

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