Comparison Operator Overloading in Python || Operator Overloading Part-4

Publié le: 02 septembre 2024
sur la chaîne: US Code Academy
82
8

In this video we discuss Comparison Operator Overloading in python
This is important part of polymorphism and OOP. The list of comparison operators overloading is achieved by functions that are given below

1. `__eq__(self, other)`: Returns True if `self` is equal to `other`.
2. `__ne__(self, other)`: Returns True if `self` is not equal to `other`.
3. `__lt__(self, other)`: Returns True if `self` is less than `other`.
4. `__le__(self, other)`: Returns True if `self` is less than or equal to `other`.
5. `__gt__(self, other)`: Returns True if `self` is greater than `other`.
6. `__ge__(self, other)`: Returns True if `self` is greater than or equal to `other`.

#pythonprogramming #python #pythontutorial

‪@USCodeAcademy‬


Sur cette page du site, vous pouvez voir la vidéo en ligne Comparison Operator Overloading in Python || Operator Overloading Part-4 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur US Code Academy 02 septembre 2024, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 82 fois et il a aimé 8 téléspectateurs. Bon visionnage!