File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -439,14 +439,15 @@ Output:
439
439
Special dunder methods in classes
440
440
==================================
441
441
442
- Below we will see some special dunder methods (the methods which has `__ `
443
- before and after the name, example: `__init__ `, we call it *dunder init *).
442
+ Below, we will see some special dunder methods (the methods which have double
443
+ underscores `__ ` before and after the name, example: `__init__ `, we call it
444
+ *dunder init *).
444
445
445
446
__len__ method
446
447
---------------
447
448
448
449
Dunder len is a method used by the *len * function to know the length of any
449
- iterator or similar objects. It should return an Integer. *len * function
450
+ iterator or similar objects. It should return an Integer. The *len * function
450
451
verifies if the returned value is Integer or not.
451
452
452
453
::
@@ -474,7 +475,7 @@ The output:
474
475
__contains__ method
475
476
--------------------
476
477
477
- This method helps us to use `in ` with out objects. For example, if we want to
478
+ This method helps us to use `in ` with our objects. For example, if we want to
478
479
match `"kushal" in studnet1 ` to be `True `, we implement `__contains__ ` method
479
480
in our class.
480
481
You can’t perform that action at this time.
0 commit comments