Learn the 7 usages of Underscore ( _ ) character in Python programming

preview_player
Показать описание
All programming languages do have some common elements; inputs, functions, outputs, variables, ... . But there are also unique idea in some programming languages and if you want to know about them, you need to specifically study them. This is what makes a person proficient in a specific programming language.

One of these is the usage of underscore ( the _ ) in Python programming. In this video I will show you 7 different usages of this character from a very trivial "digit separator" to a more cool "underscore as a dummy variable" and some more advanced topics like the meaning of __name__ == "__main__" which you might see in some source codes (and most of the libraries).

Lets start and let's write better code!

00:40 - Underscore to separate digits in long numbers
01:40 - _ is the last result in IDLE
02:49 - underscore as dummy variable
04:52 - _ After python keywords as variable names
06:16 - Underscore before variable as a weak local
07:36 - two underscore before class members
08:45 - Variables with two underscores on both sides, like __name__
Рекомендации по теме
Комментарии
Автор

Most of them were new to me. Thanks a lot 🙏

Hotcodes_Academy
Автор

Not surprisingly, wonderful as always ✌️

vahidyounesi
Автор

It was very useful and interesting, I didn't know there was such a feature for underscore, thanks Jadi

abolfazlalz
Автор

_ is a dummy variable in lots of programming languages like nodejs and golang

muhammedhusseinkarimi
visit shbcf.ru