I'm working on a program that converts numbers to binary and vice versa. When the user enters a binary string such as 1011110110 it's converted to decimal and printed. I also want to print out the users inputted string like 10 1111 0110.
I have tried
print("Binary \t=\t " + ' '.join(binaryString[i:i+4] for i in range(0, len(binaryString), 4)))
Which will print out as 1011 1101 10. I'm wanting the spaces to start at the end of the string working forward like 10 1111 0110.