Python : Arithmetic Formatter help

Hello everyone,
I need help I don’t understand why my code doesn’t work
link : https://repl.it/@CLIRD11/boilerplate-arithmetic-formatter#arithmetic_arranger.py
Thank you for your help

you are returning a string with only last problem, all your variables are iside the loop so are being overwritten at each passage. You can see your code being executed, Here the link to pythontutor with already your code to see it executing