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.