Learn practical skills, build real-world projects, and advance your career
Created 3 years ago
# Task:
Sameer is an employee , his salary is 5000. , his job is to approve
Loan.
Fill in the blanks:
#A. Class : ____Employee________
#B. Object: _____Sameer_______
#C. Property: ____Salary=5000________
#D. Method: _____approveLoan()________
# let us simulate the above scenario
class Employee: #<- how to create a class
salary=5000 #<-- a variable is a property
def approveLoan(self): #<-- this is how we define method
print('i approve loan')
sameer = Employee() # <- here we are creating the object
sameer.approveLoan()# here we are calling the method via object
i approve loan
# grammer to create object
# objectname = classname()
# grammer to call method via object
# objectname.method_name()