 <p><code>raw_input()</code> takes the input as string. In your <code>if</code> condition you are compering a string with a integer. make your <code>if</code> like this,</p> <pre><code>if float(bN[-1]) == 1: print "The binary number was odd so your number will contain 2 decimals" print "The number is now %.2f" % float(aN) elif float(bN[-1]) == 0: print "The binary number was even so your number will contain 1 decimal" print "The number is now", bN[0:3] </code></pre> <p>If you want to print 2 digits after the decimal point, you can follow this approach.</p>