| 1 | class Employee: |
| 2 | language = "Python" # This is a class attribute |
| 3 | salary = 1200000 |
| 4 | |
| 5 | def __init__(self, name, salary, language): # dunder method which is automatically called |
| 6 | self.name = name |
| 7 | self.salary = salary |
| 8 | self.language = language |
| 9 | print("I am creating an object") |
| 10 | |
| 11 | |
| 12 | def getInfo(self): |
| 13 | print(f"The language is {self.language}. The salary is {self.salary}") |
| 14 | |
| 15 | @staticmethod |
| 16 | def greet(): |
| 17 | print("Good morning") |
| 18 | |
| 19 | |
| 20 | harry = Employee("Harry", 1300000, "JavaScript") |