Visitar URL original
Update ClassesandObjects.md · VenkatAdd/PythonScript@de2b8b5 · GitHub
Skip to content

Commit de2b8b5

Browse files
authored
Update ClassesandObjects.md
1 parent 09b1a20 commit de2b8b5

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

‎Class/ClassesandObjects.md‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
### What is mean by class
66
- Almost everything in Python is an object, with its properties and methods.
7-
- The primitive data structures available in Python, like numbers, strings, and lists are designed to represent simple things.But when you need to handle complex things we required classes.
7+
- The primitive data structures available in Python, like numbers, strings, and lists are designed to represent simple things. But when you need to handle complex things we required classes.
88
- Classes are used to create new user-defined data structures that contain arbitrary information about something. 
99

10-
Consider a simple example if there are 5 person and you want to save age,name,salary normally then you need to creates lots of variable for each person.you can reduce this using classes and object . Just normal create class with age,name,salary attribute And create a class object for every person when you calling to class.
10+
Consider a simple example if there are 5 people and you want to save age, name, salary normally then you need to creates lots of variable for each person.you can reduce this using classes and object. Just normal create a class with age, name, salary attribute And create a class object for every person when you calling to class.
1111

12-
- class just provides structure—it’s a blueprint for how something should be defined.
12+
- a class just provides structure—it’s a blueprint for how something should be defined.
1313
- A class is a code template for creating objects. Objects have member variables and have behaviour associated with them.
14-
- class contains collection of attributes and methods.
14+
- the class contains a collection of attributes and methods.
1515

1616

17-
### How to define class in Python?
18-
- In Python a class is created using **class** keyword
17+
### How to define a class in Python?
18+
- In Python, a class is created using **class** keyword
1919
- Then you add the name of the class (starting with a capital letter.)
2020

2121
Syntax:
@@ -51,7 +51,7 @@ class Person():
5151
print("i am from Display method")
5252
```
5353

54-
**Note**:-if you run above programm you will not get any output because a class is useless until it's object is created.
54+
**Note**:-if you run above program you will not get any output because a class is useless until it's an object is created.
5555

5656
### How to create an empty class
5757

@@ -61,26 +61,26 @@ class Person:
6161
pass
6262
```
6363

64-
### Some standard rules to create class
65-
- class name first character should be in capital case.
66-
- Class name must be started with alphabets and underscore(_).
67-
- Do not use special keyowords as class name.
68-
- do not use special character in class name except underscore(_).
69-
- class name can be combination of alphabets,digit, underscore but starting character should be underscore or alphabets only.
70-
- do not use space in class name.
64+
### Some standard rules to create a class
65+
- class name first character should be in a capital case.
66+
- The class name must be started with alphabets and underscore(_).
67+
- Do not use special keywords as the class name.
68+
- do not use a special character in the class name except underscore(_).
69+
- the class name can be a combination of alphabets, digit, underscore but the starting character should be underscore or alphabets only.
70+
- do not use space in the class name.
7171

7272

7373
## Objects
7474
### what is mean by object
7575
- An object is an instance of a class.
7676
- Using object we can access class attributes and methods.
77-
- we can also modify public class attributes using object.
77+
- we can also modify public class attributes using the object.
7878

79-
## How to create an class object
79+
## How to create a class object
8080

81-
After defining the class the procedure to create an object of an class
81+
After defining the class the procedure to create an object of a class
8282

83-
- use class name to create an object
83+
- use the class name to create an object
8484

8585
Syntax:
8686
```python

0 commit comments

Comments
 (0)