Hi @KQ6NO. A community member has shared instructions for adding a printing capability to Arduino IDE by installing an extension:
https://forum.arduino.cc/t/no-print-option-available/700046/18
However, I agree with @J-M-L
statement that is really isn't necessary to print out your code for this purpose. Arduino IDE is based on a development editor/IDE named VS Code. The lack of a built-in printing capability in Arduino IDE is due to VS Code not having such a capability. VS Code has been, by a large margin, the most popular IDE in the world for the last 7 years. It seems that all those millions of developers who chose VS Code over other excellent alternatives don't miss a printing capability too much.