Create Classes at Python
Dear All, Today, I discuss about Class in Python. in Object Oriented Programming (OOP) we must have known some OOP Concepts such as Inheritance, Polymorhism, Overloading, and of course basic concept using Class and Object. At this ocassion, I would to share to make simple Class in Python for Aritmethics such as how to count largenes from the rectangle. Oke, let's practice, please open your Python IDLE and type code bellow : >>>class Segiempat: def __init__(self, p, l): self.panjang = p self.lebar = l def luas(self): return self.panjang * self.lebar def keliling(self): return 2 * (self.panjang + self.lebar) Oke, on the source code above ; we create class named Se giempat and we also create some functions ( init, fucntion of luas and ...