In this video, we will take a look at a common conditional statement in Python:
if __name__ == ‘__main__’:
This conditional is used to check whether a python module is being run directly or being imported.
✅ Support My Channel Through Patreon:
✅ Become a Channel Member:
✅ One-Time Contribution Through PayPal:
✅ Cryptocurrency Donations:
Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
✅ Corey’s Public Amazon Wishlist
✅ Equipment I Use and Books I Recommend:
▶️ You Can Find Me On:
My Website –
My Second Channel –
Facebook –
Twitter –
Instagram –
#Python
Nguồn: https://benjaminjcohen.com/
Xem thêm bài viết khác: https://benjaminjcohen.com/cong-nghe/
thanks Corey is this python 2 or 3 pleas?
This was really useful
Please make videos related to Machine Learning and Deep Learning too. Your explanation is by far the best on youtube, the content is pure gold. I became an instant fan. Thanks a lot for your videos.
Dear Corey,
I am recently making my own project (a package) for handling experimental images. I am trying to implement the OOP knowledge I learned from you, such as those dunder methods and properties.
However, I am still a bit confused by how do some other dunder methods/variables work, such as _future_ found often in the _init_ file. Is it possible to do a tutorial on importing packages?
Thanks man !
Definitely the best explanation
Perfect explanation of these magic methods. Cheers!
Best explaination
thank you!
thank you
It's 2020 and this is still the best explanation of this
This is the main video for python 🐍
Man fuck coding
I understand what it does but I don't get the purpose of this..? what is a real life scenario when you would use this method?
5 years later this video is still great. Thanks for this explanation, it clears up the concept perfectly.
you explained this topic very easily
love your explanation
"subscribed"
is this python 2 ?
you sound a bit sleepy
You are the BEST!
Thank youuu
Good tutorial with poor interface
Please make the font bigger so we can see better
Thanks, wanted to know how this works
So for programmers who have come from other languages and are learning pythons crazy new age way of doing things: if you run that .py file directly then it makes it the main method but if you import it and run that file its not the main method?
Is this no longer valid in Python 3?
I had the same code as in 5:39 (with parenthesis for print functions) and I received "Run From Import" despite it being run directly.
What is needed for! What is the first module?
Wow this was explained really clearly. Thanks!
honestly dude, using your videos and with a little help from a friend my coding knowledge has increased so quickly. Your videos are awesome !