title: If statement vs if else
body: <p>I have been playing with titanic data and tried a simple if statement below, without "else":</p>
  
  <pre><code>if passenger.gender == 'female':
      predict[passenger_numberId] = 1
  predict[passenger_numberId] = 0
  </code></pre>
  
  <p>My code runs fine and I get an accuracy of 63%. When I modify the statement with "if else", the accuracy increases but I do not understand why adding else is different to my simple statement above that follows the instructions per link: <a href="http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ifstatements.html" rel="nofollow">http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ifstatements.html</a>:</p>
  
  <pre><code>if passenger.gender == 'female':
     predict[passenger_numberId] = 1
  else:
      predict[passenger_numberId] = 0
  </code></pre>
  
  <p>What am I missing?</p>