title: why is my If statement is not working even if the condition is true but else is working if it is true
body: <p>I have a simple if else statement, but i have a question why is the if condition is not working even though it is true, but when the else is true it works fine.</p>
  
  <p>Can somebody tell me why my if condition is not working even if it is true?</p>
  
  <p><code>self.comboBoxCourse.currentIndexChanged.connect(self.courseChoosed)</code></p>
  
  <p>This is the if else statement:</p>
  
  <pre><code>def courseChoosed(self):
      if self.comboBoxCourse.currentIndex() == 0:
          self.pushButton_2.clicked.connect(self.courseSTEM)
          print("Your Current course is STEM")
      elif self.comboBoxCourse.currentIndex() == 1:
          self.pushButton_2.clicked.connect(self.courseICT)
          print('Your current course is ICT')
          print(self.comboBoxCourse.currentIndex())
  </code></pre>
  
  <p>If I choose STEM which is Index == 0: which is true, it is showing the print message, I don't know why but the button is not working.</p>
  
  <p><a href="https://i.stack.imgur.com/HbNWc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HbNWc.png" alt="enter image description here"></a></p>
  
  <p>Result of else statement if the combobox is ==1: and the button works really fine.</p>
  
  <p><a href="https://i.stack.imgur.com/P7yiR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P7yiR.png" alt="result of else statement"></a></p>
  
  <p>Can someone tell me why is the button function in the if statement doesn't work even if it is true?</p>