Binary to Hexadecimal converter
<p>I have written a code to try and convert a 4-bit binary number into Hexadecimal. Only thing is, when I type a value that begins with a '1' it comes up with the conversion, whereas if I type a value that starts with a '0' it doesn't work. Any help?</p>

<pre><code>print ("""Here's how the program will work. You need to get your binary number ready.
        if it is 8 bit, split it into four, because thats how hexadecimal works. Make sure all your conversions
        are slip into '4' bits like this:
        01001101 will turn into:
        0100 ,and then 1101""")
time.sleep(6)
print ("""So, for example, the program will ask you for your binary number. Like this:
        Enter your binary number here:
        Then you put in your number, like this:
        Enter your binary number here: 0100
        Lastly, the program will give you your hexadecimal number, then ask you if you would
        like to do another conversion in this area, or end program.""")
time.sleep(6)
HEXADECIMAL = int(input("Please enter your binary number here:   "))                         
if HEXADECIMAL == 0000:
    print ("Your hexadecimal value is 0")
if HEXADECIMAL == 0001:
    print ("Your hexadecimal value is 1")
if HEXADECIMAL == 0010:
    print ("Your hexadecimal value is 2")
if HEXADECIMAL == 0011:
    print ("Your hexadecimal value is 3")
if HEXADECIMAL == 0100:
    print ("Your hexadecimal value is 4")
if HEXADECIMAL == 0101:
    print ("Your hexadecimal value is 5")
if HEXADECIMAL == 0110:
    print ("Your hexadecimal value is 6")
if HEXADECIMAL == 0111:
    print ("Your hexadecimal value is 7")
if HEXADECIMAL == 1000:
    print ("Your hexadecimal value is 8")
if HEXADECIMAL == 1001:
    print ("Your hexadecimal value is 9")
if HEXADECIMAL == 1010:
    print ("Your hexadecimal value is A")
if HEXADECIMAL == 1011:
    print ("Your hexadecimal value is B")
if HEXADECIMAL == 1100:
    print ("Your hexadecimal value is C")
if HEXADECIMAL == 1101:
    print ("Your hexadecimal value is D")
if HEXADECIMAL == 1110:
    print ("Your hexadecimal value is E")
if HEXADECIMAL == 1111:
    print ("Your hexadecimal value is F")
</code></pre>

<p>You can try to run this code and start with, for example, 0110, but it will not convert. Any help?</p>

<p>replace,</p>

<pre><code>HEXADECIMAL = int(input("Please enter your binary number here:   ")) 
</code></pre>

<p>with,</p>

<pre><code>temp = input("Please enter your binary number here:   ")                       
HEXADECIMAL = int (temp)
</code></pre>

<p>plus remove sleep time if there is an error.</p>

python binary hex