I want to receive and save hexadecimal data a and output it in the form a = 0xa3 = 0b10100011 but I don't know how to convert binary.
a = input("hexadecimal a = ")
print("a = "+a+____)
You can do it as below.
a=int(input("hexadecimal a = "),16)
print("a =",bin(a))
© 2024 OneMinuteCode. All rights reserved.