Please provide a link to your replit, as the unittests there will tell you exactly where you are wrong.
But given you refer to the console - you sure you are returning strings and not just printing stuff?
Don’t comment out the test-cases, those are important ^^°
Anyway, this line will cause some problem: arranged_problems = line1 + "\n" + line2 + "\n" + line3 + "\n" + line4
You add a “\n” at the end, even if line4 is empty.