The web is full with python code examples that are either taken from vanila Python shell
>>> for i in range(10):
... print(i)
...
.... or from IPython shell:
In [1]: for i in range(10):
...: print(i)
...: print(i + 1)
...:
When I want to paste such snippets into IPython, I need to paste them into a text editor, do some find-and-replace and then paste it into IPython. I'm sure there is a better way, but can't find it.