I have searched a few solution, but it may not apply to our case. Here is a minimal code to illustrate what I was trying to do. How can we make the commented code works? We can use python 3.8+ solutions.
teams_list = ["Man Utd", "Man City", "T Hotspur"]
data = list([[1, 2, 1],
[0, 1, 0],
[2, 4, 2]])
row_format ="{:>10}" * (len(teams_list) + 1) #this code works
# these codes do not work
#customer_defined_len = 10
#row_format ="{:>customer_defined_len}" * (len(teams_list) + 1)
print(row_format.format("", *teams_list))
for team, row in zip(teams_list, data):
print(row_format.format(team, *row))