class Employee:

    def employeeDetails(self):
        # pass
        self.name = "Mathew"
        print("Name is:", self.name)

        age = 30  # Attribute without self Obj
        print("Age is:", age)

    def printEmployee(self):
        print("printing in another method")
        # we can access the name attribute from above employeeDetails method but not the age
        print("Name: ", self.name)
        # print("Age: ", age)  # this will get error


employee = Employee()

employee.employeeDetails()

employee.printEmployee()

# Employee.employeeDetails(employee) # In This way the python interpreter is taking the code, So the Self is Reffering to an Object i.e,, employee .

1b3dc8fd61b88a973f8c85c85fce195c1c8042c4
class Employee:

    def employeeDetails(self):
        self.name = 'Mathew'
        print('Name is:', self.name)
        age = 30
        print('Age is:', age)
    <mask token>


<mask token>

class Employee:

    def employeeDetails(self):
        self.name = 'Mathew'
        print('Name is:', self.name)
        age = 30
        print('Age is:', age)

    def printEmployee(self):
        print('printing in another method')
        print('Name: ', self.name)


<mask token>

class Employee:

    def employeeDetails(self):
        self.name = 'Mathew'
        print('Name is:', self.name)
        age = 30
        print('Age is:', age)

    def printEmployee(self):
        print('printing in another method')
        print('Name: ', self.name)


<mask token>
employee.employeeDetails()
employee.printEmployee()

class Employee:

    def employeeDetails(self):
        self.name = 'Mathew'
        print('Name is:', self.name)
        age = 30
        print('Age is:', age)

    def printEmployee(self):
        print('printing in another method')
        print('Name: ', self.name)


employee = Employee()
employee.employeeDetails()
employee.printEmployee()

class Employee:

    def employeeDetails(self):
        # pass
        self.name = "Mathew"
        print("Name is:", self.name)

        age = 30  # Attribute without self Obj
        print("Age is:", age)

    def printEmployee(self):
        print("printing in another method")
        # we can access the name attribute from above employeeDetails method but not the age
        print("Name: ", self.name)
        # print("Age: ", age)  # this will get error


employee = Employee()

employee.employeeDetails()

employee.printEmployee()

# Employee.employeeDetails(employee) # In This way the python interpreter is taking the code, So the Self is Reffering to an Object i.e,, employee .
