!USING PYTHON 3.1!
I never thought it could be so simple.
However I should have clarified that it's a 1 character input. But the general idea is the same. Someone suggested that I explain what is going on better, so I'm going to do that. The function 'getch()' waits for a keyboard hit. But the reason that it has to be converted so many times in the line '(str(list(str(getch()))))' is because getch() has to be annoying and add a b(It's a nonetype) before everything, and to be even more annoying, it's not a string (grrr)... So we have to first convert the whole thing to a string, put it in a list, take the 3rd item from the list, which would be the character you pressed. Convert it back to a string, then print it.
Edited 7 Years Ago by AutoPython: n/a