Skip to content

Commit 6787692

Browse files
authored
Update README.md
1 parent 005f738 commit 6787692

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,32 @@ A class mainly contains methods, attributes, instances and a prefix
3737
3838

3939
At 1, i defined a class and named it as Introduction (keep first letter in capitals).
40+
4041
At 2, i defined a method by def and the method name is __init__(), having 3 parameters self, age, name
42+
4143
At 3, i mentioned attributes by using self.(anything you like to print) = the same parameter,
4244
in this case our attributes are name and age
45+
4346
At 4, i defined another method describe(), which will take care in what manner the output will be printed.
47+
4448
At 5, i gave the print command which basically gives us the output when describe method is called via instance.
49+
4550
At 6, i used str() function (use to define strings) with age.self, as python will only take strings not integers.
51+
4652
At 7, i mentioned an instance 'intro' which is use to call the class Introduction,
4753
also the values of parameters (name, age) are defined here (that is 'yash', 23)
54+
4855
At 8, i used the instance (intro) and method (describe) together in order to get the output that particulat method only
4956

50-
Note: You can define as many as methods you like and to get all of them printed you need to mention the method name
51-
with the instance name. As shown above (8).
57+
* Note: You can define as many as methods you like and to get all of them printed you need to mention the method name with the instance name. As shown above (8).
58+
5259

5360

5461

5562

5663

64+
* Brief Explanation:
5765

58-
# Brief Explanation:
5966
The __init__() method at is a special method that Python runs automatically whenever
6067
we create a new instance based on the Dog class.
6168
This method has two leading underscores and two trail-ing underscores,

0 commit comments

Comments
 (0)