In this video, we dive deep into the various uses of underscores in Python and how they can help you write cleaner, more maintainable code.
What you'll learn:
1. ⚙️ Single underscores (_) in interactive interpreters and throwaway variables.
2. 🔒 Single leading underscores (_var) for indicating internal use.
3. 🔐 Double leading underscores (__var) for name mangling and avoiding subclass conflicts.
4. ✨ Double leading and trailing underscores (var) for special methods and magic functions.
5. 📦 Leading underscores in module names for indicating internal modules in a package.
We'll also walk through a practical example of structuring a Python package with internal and public modules, demonstrating the importance of using underscores to control the public API. By the end of this video, you'll have a solid understanding of how to use underscores effectively in your Python projects.
⏰ * Time Stamp:
00:00 Introduction of Underscores
00:58 Single Underscore (_) Usage
05:10 Single Leading Underscore (_var) Usage
07:05 Double Leading Underscore (__var) Usage
10:38 Double Leading and Trailing Underscore (__var__) Usage
12:52 Leading Underscore in Module Names (Practical Example: Creating a Python Package)
📁 Source Code: https://github.com/AbhisheakSaraswat/...
👉 *Python NumPy Playlist: • Python Numpy Tutorial
👉 Python Excel Automation: • Excel Automation Using Python
👉 Python Teaser: • A Beautiful Python Programming Teaser | In...
👉 Python Pandas Tutorial: • Python Pandas Tutorial | What is Pandas | ...
👉 Python Playlist: • Python Tutorial for Beginners
👉 Python Data Structure Playlist: • Python Data Structure
👉 Python OOPs Playlist: • Object Oriented Programming Tutorials Usin...
👉 Python Project for Data Analysis- Exploratory Data Analysis | Data Analyst Project : • Python Data Science: Analyzing LinkedIn Co...
👉 Telegram Link: https://t.me/+32-TodtiOvo2Njk9
👉 Medium Story: 📖 / programmingisfun
👉 LinkedIn: / abhisheak-saraswat
👉 ProgrammingIsFun: / 10365183
On this page of the site you can watch the video online Python Underscore (_) Guide Best Practices & Examples with a duration of hours minute second in good quality, which was uploaded by the user Programming Is Fun 12 July 2024, share the link with friends and acquaintances, this video has already been watched 871 times on youtube and it was liked by 30 viewers. Enjoy your viewing!