This has nothing to do with the modulo operation. The interactive interpreter will crash on every 2nd command invoked.
The OS 10.9 (Mavericks) upgrade caused instability in some Python releases. To fix this specific issue, download and run the patch through the Terminal:
>>> curl -O http://bugs.python.org/file32324/patch_readline_issue_18458.sh
>>> openssl sha1 patch_readline_issue_18458.sh
>>> sh ./patch_readline_issue_18458.sh
Newer Python releases have fixed the problems introduced with Mavericks. Better to install the latest version at https://www.python.org/downloads/
Thanks to Hyperboreus for finding the solution in the question comments.