Code.eval_string("IO.puts('a')") will print the a. When you do IO.puts(result), that is printing the :ok.
Code.eval_string("IO.puts('a')")
a
IO.puts(result)
:ok