I\'m trying to do some of the code golf challenges, but they all require the input to be taken from stdin. How do I get that in Python?
stdin
Python also has built-in functions input() and raw_input(). See the Python documentation under Built-in Functions.
input()
raw_input()
For example,
name = raw_input("Enter your name: ") # Python 2.x
or
name = input("Enter your name: ") # Python 3