Python OOP Tutorials | Private Variables in Python | Python Private attributes and methods

preview_player
Показать описание
In this Python Tutorial for Beginners video I am going to show How to declare Private methods in Python. To create a private method in a class you can use double underscores in front of your member, so you they are made local to the class.

#PythonTutorialforBeginners #ProgrammingKnowledge #LearnPython #PythonCourse
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Рекомендации по теме
Комментарии
Автор

sir as I have studied in python for a private variable we use single underscore. which is a naming convention. just for a developer to make attention in order to deal with private variables. double underscore is used for a dunder concept in which python used the name mangling concept and that is used for inheritance 0urpose for clarifying the ambiguity of same name from multiple parent classes.
can you sir please clear my confusion.

aqibrehman
Автор

great video, thank you for uploading it!!!

anodomaniD
Автор

I wish it just had private specifier. Adding double underscores makes code look ugly.

izvarzone
Автор

Learn about python variables and methods

BelajarPemrogramanPemula
join shbcf.ru