| 1 | initial version |
You really want this function in Python, I guess. Here are two relevant links I found, knowing nothing about getchar; I bet you will be able to do better.
Apparently it's nontrivial to get something that works exactly the same.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.