-1
I’m trying to personalize the spacing used in one string formatted, center to be very visual between the lines. The program is returning me value error.
Follows the code:
def titulo(msg):
tam = len(msg) + 4
print('=' * tam)
print(f'{msg:^tam}')
print('=' * tam)
titulo('TRATAMENTO DE ERROS E EXCESSÕES')
Python does not accept an integer variable as a parameter to use for spacing? In this case the variable tam.
What would be the right way to center exactly between the lines, taking into account their size and the message itself.