A simplified version of my problem is as follows. The current code/output I have is problematic.
Code:
file.write("AAAA" + "\n")
file.write(num + " BBBBB") #num is a random number
Current output:
AAAAA
20 BBBBB
I would like to align the A's and B's so that it looks like this:
AAAAA
20 BBBBB
Specifically though, I need the output to work for any number. I.e, "2000BBBB" etc.
Making it work for the example I have given is easy enough, I could just add spacing. The problem here is writing code that will essentially predict where the second line's B's will be located.
I hope that makes sense, thank you.
len(num) * " "i.e. len(num) * space