echo
appends a newline at the end by default, so it will give a different hash.
In python, with the newline ending
>>> print hashlib.md5("lol\n").hexdigest()
59bcc3ad6775562f845953cf01624225
Standard echo command, with the newline ending omitted.
$ echo -n lol | md5sum -
9cdfb439c7876e703e307864c9167a15 -