So I have a code that I am working on. I have run into a problem where I cannot figure out a way to convert a list I have in decimal to binary. I have searched for examples, but cannot find a solution. If you could help me out with a way to handle this way specifically that would be great thanks.
Code
PT = input("Please enter your plaintext: ")
PT = PT.lower()
K = input("Please enter your key: ")
K = K.lower()
output1 = []
output2 = []
for character in PT:
if character.isdigit():
digit = ord(character) - 22
output1.append(digit)
elif character.isalpha():
number = ord(character) - 97
output1.append(number)
else:
print("Please use letters and numbers only. (Plaintext)")
break
for character in K:
if character.isdigit():
digit = ord(character) - 22
output2.append(digit)
elif character.isalpha():
number = ord(character) - 97
output2.append(number)
else:
print("Please use letters and numbers only. (Key)")
break