Tell us what’s happening:
When printing the second line, I understand that I need to leave a single space between the operator and the longest of the two operands. I haven’t been able to figure out how to do that. Do I need to do something related to the longest length of the n1 and n2 or… I’ve been stuck here for a while.
I appreciate any feedback and help!
Thank you.
I will link my repl here.
https://repl.it/@mingurangpingu/boilerplate-arithmetic-formatter-1#main.py
Your code so far
first_line += n1.rjust(width)
second_line += (operator + ’ ’ + n2).rjust(width)
dash_line += ‘-’ * width
ans_line += str(ans).rjust(width)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.193 Safari/537.36
.
Challenge: Arithmetic Formatter
Link to the challenge: