Guest User

Untitled

a guest
Dec 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. def hex_bin(hex):
  2. value = int(hex,16)
  3. binary = int(bin(value)[2:])
  4. binary = str(binary)
  5. if len(binary) != 16:
  6. minus = 16 - len(binary)
  7. newbinary = "0" * minus + binary
  8. return newbinary
Add Comment
Please, Sign In to add comment