What is data hiding in python?



What is data hiding in python?..

Answer / Bhoopendar Singh

Data hiding in Python refers to the practice of encapsulating or hiding class data (variables) from external access, limiting it to specific methods within the class. This helps promote modularity and protects data integrity. In Python, this can be achieved by defining variables as private instance variables (using double underscores, e.g., _variable_name).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What does __name__=='__main__' in python mean?

1 Answers  


What is the iterator protocol?

1 Answers  


What is the output of the following code and why?

1 Answers  


Write a program to check given number is prime using for loop with else?

1 Answers  


How do I start learning python?

1 Answers  


How do you handle exceptions with try/except/finally in python?

1 Answers  


What is meant by r strip() in python?

1 Answers  


Why python is used?

1 Answers  


Are methods objects in python?

1 Answers  


What are the tools that help to find bugs or perform analysis?

1 Answers  


What is tkinter?

1 Answers  


How do you debug a program in python? Is it possible to step through python code?

1 Answers  


Categories