title: class employee print method
body: <p>I am studying classes in python programming in jupyter notebooks and google colab.</p>
  
  <p>I don't understand the results with respect to this class.</p>
  
  <pre><code>class employee_constructor():
  
    def __init__(self,name,surname,salary):
     self.name=name
     self.surname=surname
     self.salary=salary
  
    def increasesalary(self,percentage):
      self.salary=self.salary*(1+percentage/100)
  
    def displayEmployee(self):
       print('this employee is {} and gets {} dollars'.format(emp1.name,emp1.salary))
  </code></pre>
  
  <p>now I try to print out results:</p>
  
  <pre><code>emp1=employee_constructor('jose','ferro',1000)
  emp2=employee_constructor('manolo','rod','1500')
  emp1.displayEmployee
  print('before increase',emp1.salary)
  emp1.increasesalary(5)
  emp1.increasesalary(5)
  print('after increase',emp1.salary)
  
  print(emp1.salary)
  
  # this line does not give error and does nothing:
  emp1.increasesalary
  print(emp1.salary)
  
  # this line gives error:
  # increasesalary() missing 1 required positional argument: 'percentage'
  emp1.increasesalary()
  </code></pre>
  
  <p>I don't understand why running the method without the parenthesis would not cause any error (actually the method is not run) whereas with the parenthesis (and not passing the neccesary variable through an error)</p>
  
  <p>secondly, how can I avoid such kind of errors? i.e. if the user passes nothing assume vale zero</p>
  
  <p>note:
  <a href="https://stackoverflow.com/questions/625083/what-init-and-self-do-on-python">this question</a> explains <strong>init</strong> method and was proposed as solution. My question is related but is not answered there</p>