I currently have a list with a bunch of binary values which are in string format. I would like to add a space in between every 4th value so a binary value such as:
'111111111111'
becomes
'1111 1111 1111'
For example purposes, lets say my current list is:
bin = ['0001', '1111', '111111111111']
and I want a new list with the values:
new_bin = ['0001', '1111', '1111 1111 1111']
How do I iterate over the list and add the necessary white spaces in between every 4th character? The strings which only have 4 characters do not apply and do not need to be adjusted.