I Have the code here which converts ASCII to Base 64, inputting "Cat" gives me the output The Base 64 is Q The Base 64 is 2 The Base 64 is F The Base 64 is 0
How can I make the output print on one line thus that "Cat" will give "The Base 64 is Q2F0"?
b64_table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
number = 0
numchar = 0
code = 0
user_input = input("Input")
for char in user_input:
numchar = numchar + 1
if numchar == 1:
number = ord(char)
elif numchar > 1:
number = ord(char) + (number << 8)
if numchar == 3:
i=3
for i in (3,2,1,0):
code = number >> (6 * i )
#print(int(code))
print("Yout base64 is "+ b64_table[int(code)])
number = number - (code << (6 * i))