I'm trying to write a binary translator - with a string as an input and its binary representation as output.
And I'm having some difficulties, I wrote in variable the translation for each letter, but they are variables, not strings, so I want to take an input from that matches with the name of the variable and prints the result:
a = "01000001"
b = "01000010"
c = "01000011"
d = "01000100"
# all the way to z
word = input("enter here: ")
print (word)
When I run this I enter a word and it just returns the same word to me but when I write print(a) it returns 01000010 but I can't get it to work with the input.
Can someone tell me where I'm doing something wrong?
a = "01000001"etc. - if you mean ASCII codes, yours are for capital letters (A,B, etc.)