I know this is an easy one but I am brand new to programming and any help would be greatly appreciated.
I have a text file that has a bunch of numbers in it (one per line). I need to open the file and split the number into three. If the number is “123456” i need to split it into “14”,”25″,”36″ in other words I need it to go (x1x2), (y1y2), (z1,z2) for a number x1y1z1x2y2z2. For odd numbers I want to add a zero to the last group to even it out. Thanks for the help, I am hopeless at programming.
So because you’re slicing into thirds, the problem isn’t odd numbers, but is rather numbers not divisible by 3. Here’s a function that accepts a string and returns a tuple of slices of that string.
Here’s a demonstration of its behavior: