PYTHON DATA HIDING

  • By Sneha Ranbhidkar
  • April 27, 2023
  • Python
Python Data Hiding

PYTHON DATA HIDING

Basically, it starts with data. Data hiding in Python that is publicly stored can be handled by anyone to protect our data from unauthorized areas. For that purpose, this concept was introduced in our Python world. Let’s see what is meant by Python Data Hiding

How does Python Data Hiding work?

What are the advantages and disadvantages?

Let’s start then – – – >

For Free, Demo classes Call: 02071171500

Registration Link: Click Here!

What is meant by Python data hiding?

Basically data hiding can be defined as hiding the data from a program to secure for safety. It is the concept of object-oriented programming which includes contains like Data members.

Note: Python classes in Pune are designed to help you gain a thorough understanding of the language, starting with the basics and progressing to more advanced topics.

How it works.?

Data hiding in Python import all members which belong to the class and it denies the entry of object integrity which prevents unauthorized changes.

It minimizes not only complexity but also increases robustness after implementing all the interdependencies of requirements of the software.

It can also be known as information hiding. Where there is the process of isolation after the requirement of the project. 

So for example :

If we create a class and keep the data member as in private access modifier then it is difficult to trace that data so we can say that data hiding is done with the help of private access specifier.

Python Data Hiding

For Free, Demo classes Call: 02071171500

Registration Link: Click Here!

Program regarding data hiding :

Class Sneha :

__privatename = 0

Def lname ( self ) :

Self.__privatename+=”ranbidkar”

Print(self.__privatename)

Nm=Sneha()

Nm.lname()

Print(nm.__privatename)

 

Advantages of Data Hiding

  • It will be helpful to secure our data from misuse by other people. 
  • In class, the object is disconnected after implementation and utilization of the object.
  • Objects are very helpful and come from an object-oriented programming language.
  • It will increment the security of our data.

For Free, Demo classes Call: 02071171500

Registration Link: Click Here!

Disadvantage of Python Data Hiding 

  • The main disadvantage is programmers need to write lengthy code just to secure data but due to this is it takes more time for the execution of code.
  • Mostly the linking and non-linking of objects happens for quick results but due to data hiding concept, the linkage will be lost.

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –  – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –  

One more example we can discuss here :

Class hide :

__hidwor = 0

Def add (self , cnt) :

Self.__hidwor + = cnt

Print (self,__hidwor)

 

Hidob = hide ()

Hidob.add(6)

Hidob.add(45)

For more information do visit: Click Here

Author:-

Sneha Ranbhidkar
Call the Trainer and Book your free demo Class For Python

Call now!!! | SevenMentor Pvt Ltd.

© Copyright 2021 | SevenMentor Pvt Ltd.

Submit Comment

Your email address will not be published. Required fields are marked *

*
*