The right tool for your use case is the listings package: In addition to coloring the prompts, it will do a whole bunch of other things appropriate to code as well. It doesn't color python prompts by default, but it's easy to customize.
It can be as simple as this:
\usepackage{listings}
\usepackage{xcolor}
\lstset{
otherkeywords={>>>}, % used only because >>> is not an identifier
morekeywords=[3]{>>>},
keywordstyle={[3]\color{blue}}
}
\begin{document}
\begin{lstlisting}
>>> 1+1
2
>>>
\end{lstlisting}
But you'll probably want a few more adjustments to make it more python-like.
If you like syntax coloring, add style={python-idle-code} to \lstset{} to get an IDLE-like color scheme. (It's defined in listings-python.prf, which must be included separately. Clunky...) Or you could use language={python}, for a black and white basic scheme. Either way, I would also recommend showstringspaces=false and tabsize=4. So here's a complete almost-MWE:
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
% Optional:
\input{listings-python.prf}
\lstset{
style={python-idle-code},
showstringspaces=false, % true by default for python
% tabsize=4,
}
% Blue prompts
\lstset{
otherkeywords={>>>}, % used only because >>> is not an identifier
morekeywords=[3]{>>>},
keywordstyle={[3]\color{blue}},
}
\begin{document}
\begin{lstlisting}
>>> 1+1
2
>>> def hello():
print("Hello, world!")
\end{lstlisting}
\end{document}
Output:

>signs, which does not seem to be what the OP is asking for. – Andrew Swann Oct 07 '15 at 07:12\def>with\def>>>. – Salim Bou Oct 07 '15 at 11:41>>>>? – Andrew Swann Oct 07 '15 at 13:21\def>>>does not work, single>results inUse of > doesn't match its definition. – Andrew Swann Oct 07 '15 at 13:23