I have some formatted columns that I'm printing. I would like to use the following variables to set the lengths in my .format arguments
number_length = 5
name_length = 24
viewers_length = 9
I have
print('{0:<5}{1:<24}{2:<9}'.format(' #','channel','viewers'), end = '')
Ideally I would like something like
print('{0:<number_length}{1:<name_length}{2:<viewers_length}'.format(
' #','channel','viewers'), end = '')
But this gives me an invalid string formatter error.
I have tried with % before the variables and parenthesis, but have had no luck.