When you work on interpreter( three ">>>" is an indication you are working on interpreter) then you don't need to write print (although you can)
When you work with script, like a python program in codeplayground, then you must if you want to print any data.
Your prompt (aka Interpreter) is not the same as a python program.
Stuff you put in a file is evaluated at runtime, while the interpreter prints the returning value, you don't have to type the print.
If you put a string in a file, the file doesn't return anything, you have to print it.