Thank you for you’re post it helps me starting the puzzle . i was a little bit lost. i have to work on my regex
Hi ![]()
Bit late to the party but I was trying this puzzle and I encounter a very frustrating problem.
Every time I print, the output automatically prints on a new line, without me actively telling the output to do so. This never happened on any of my previous coding challenges (easy). I’m quite new to this stuff so I might look over something, however it seems that for all the test cases, I’m neatly outputting the expected ascii characters, just with way too many new lines.
For example on test case one:
1sp 1/ 1bS 1_ 1/ 1bS nl 1( 1sp 1o 1. 1o 1sp 1) nl 1sp 1> 1sp 1^ 1sp 1< nl 2sp 3|
/
\
_
/
\
(
o
.
o
)
>
^
<
|||
(I have also printed t itself just to show what the outcomes should be).
I also noted that I can’t print to debug like print(“print job here”, file = sys.stderr). I’m using Python 3.
Any help is appreciated!
Kind regards
print() in Python adds a newline by default, so each call appears on its own line. Two of the possible options to avoid this are:
- building the full string first and printing once, or
- setting a custom
endparameter, e.g.print("text", end = "").
For debugging, add flush = True so the text is output to the console immediately. (It’s also mentioned in the default / starting code.)
Insane how such a small element made me go from 0 % to 100 %. I just had to add end = ““ (which I’ve never had to do before in the other puzzles). Thanks!!
The debug is also working correctly
.