In Emacs 28, `python-shell-send-string' prints an additional newline between the prompt and output (among other things, so you can tell whether or not the inferior process is busy at any given time). However, this interferes with ob-python, see e.g. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50514 The attached patch indicates how to solve the problem. As a permanent solution, I would suggest to replace org-babel-chomp and actually strip whitespace from both ends of the string outputted from the Python interpreter. (IPython even has a configuration option to add extra whitespace before or after the output.)