That is weird, I see a different behaviour. The print is supposed to print individual lines but you use the default space separator when you need newlines. Maybe you tuned the terminal width to fit your output? Try to use newlines as separators between individual print’s arguments:
print(*instruction(12), sep='\n')