Probably an easy question that I couldn't quite find answer to before...
I'm formatting a table (in text) to look like this:
Timestamp: Word Number
The number of characters between the : after timestamp and the beginning of Number is to be 20, including those in the Word (so it stays aligned). Using python I've done this:
offset = 20 - len(word)
printer = timestamp + ' ' + word
for i in range(0, offset):
printer += ' '
printer += score
Which works, but python throws an error at me that i is never used ('cause it's not). While it's not a huge deal, I'm just wondering if there's a better way to do so.
Edit:
Since I can't add an answer to this (as it's marked duplicate) the better way to replace this whole thing is
printer = timestamp + ' ' + word.ljust(20) + score