beginner – Mysterious value "None"

Inside of by() you print the string characters.
The return of by() is none.

So running print (by (222) you run the standard print routine, but you still print the return value of by()which is none.

Simply being executed by (222) will print the expected result.