Let's say I want to print to the screen. In pure functional programming languages like Haskell or Elm, you can simply leave it to the runtime engine to do it for you. Your function doesn't need to do the dirty job.
If I move on to non-functional programming languages like python, C++, etc, I cannot signal the runtime environment to print text on screen, generate a random number, talk to the DB, etc. I have to do the operations myself. This makes functions impure since they are changing the state and/or relying on external states to work.
How can I write pure functions in python, C++, JS, etc since these languages lack features like Action, Command, etc to let the function communicate with the runtime environment?
I prefer learning with simple examples. If possible, can you show me how to write a pure function which prints text on the screen using a non-functional language (preferably python or C++)?