To print exit code of the last command type:
echo $?
Remove all *.pyc files from the current directory (and subdirectories):
find . -name \*.pyc -delete