Skip to content

Commit 770eebc

Browse files
Update README.md
1 parent 8d5bf2d commit 770eebc

File tree

1 file changed

+7
-7
lines changed
  • Object-Oriented-Programming-Concepts/imgs

1 file changed

+7
-7
lines changed

Object-Oriented-Programming-Concepts/imgs/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ stud.learn() # Calling method
110110
```
111111
### Output: Welcome to Guranna Gouda's class on Python Programming
112112

113-
#How to insert Value Using Construct
113+
# How to insert Value Using Construct
114114
```python
115115
class Student:
116116
"""This is student class with data"""
@@ -220,11 +220,11 @@ Encapsulation can be achieved by declaring the data members and methods of a cla
220220

221221
Access modifiers limit access to the variables and methods of a class. Python provides three types of access modifiers private, public, and protected.
222222

223-
-**Public Member:** Accessible anywhere from otside oclass.
224-
-**Private Member:** Accessible within the class
225-
-**Protected Member:** Accessible within the class and its sub-classes
223+
- **Public Member:** Accessible anywhere from otside oclass.
224+
- **Private Member:** Accessible within the class
225+
- **Protected Member:** Accessible within the class and its sub-classes
226226

227-
-**Public Member**
227+
- **Public Member**
228228
Public data members are accessible within and outside of a class. All member variables of the class are by default public.
229229
```python
230230
class Employee:
@@ -253,7 +253,7 @@ Name: Jessa Salary: 10000
253253
Name: Jessa Salary: 10000
254254
```
255255

256-
-**Private Member**
256+
- **Private Member**
257257
We can protect variables in the class by marking them private. To define a private variable add two underscores as a prefix at the start of a variable name.
258258

259259
Private members are accessible only within the class, and we can’t access them directly from the class objects.
@@ -332,7 +332,7 @@ Working on project : NLP
332332
Project: NLP
333333

334334
```
335-
-**Getters and Setters in Python**
335+
- **Getters and Setters in Python**
336336
To implement proper encapsulation in Python, we need to use setters and getters. The primary purpose of using getters and setters in object-oriented programs is to ensure data encapsulation. Use the getter method to access data members and the setter methods to modify the data members.
337337

338338
In Python, private variables are not hidden fields like in other programming languages. The getters and setters methods are often used when:

0 commit comments

Comments
 (0)