Hello folks. I need a python program that is converting a number in binary like 2=10.
Thanks in advance for your help and sorry for my broken english
Decimal To Binary:
print("Converting Decimal Numbers To Binary\n\n")
a=int(input("Enter The Number: "))
print("The binary number of the decimal number", a, "is\n", i,h,g,f,e,d,c,b)
Binary To Decimal:
a=str(input("Enter The Number: "))
print("The Decimal Number Equal To The Entered Binary Number Is", (j2**0)+(k21)+(l*22)+(m2**3)+(n24)+(o*25)+(p2**6)+(q2**7), "\b.")
Completely Working Code...
num = int(input('Input number between 0 and 255 and I will convert it into binary.'))
if num < 256:
this code it quite short but it has an annoying 0b at the start and i dont know how to remove it, but as long as you can ignore it or can remove it yourself, feel free to use it, it took me a couple minutes to make