Skip to content

Commit ec3b50b

Browse files
committed
Changed behaviour of printing multi-line outputs
1 parent 65515b2 commit ec3b50b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

EulerPy/euler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ def verify_answer(problem):
116116
try:
117117
if output[-1] == '\n':
118118
output = output[:-1]
119+
120+
# If there is still a newline, the output is multilined. Print the
121+
# first line of the output on a separate line from the "checking
122+
# against solution" message.
123+
if '\n' in output:
124+
output = '\n' + output
125+
119126
except IndexError:
120127
output = "[no output]"
121128

0 commit comments

Comments
 (0)