The simplest way for python 2.x is
var = raw_input()
print var
Another way is using the input() function; n.b. input(), unlike raw_input() expects the input to be a valid python expression. In most cases you should raw_input() and validate it first. You can also use
import sys
var = sys.stdin.read()
lines = sys.stdin.readlines()
more_lines = [line.strip() for line sys.stdin]
sys.stdout.write(var)
sys.stdout.writelines(lines+more_lines)
# important
sys.stdout.flush()
As of python 3.0, however, input() replaces raw_input() and print becomes a function, so
var = input()
print(var)