函数:raw_input()和input()
>>> a1 = raw_input("raw_input_str: ")
raw_input_str: hello
>>> print a1,type(a1)
hello
>>> a2 = input("input_str: ")
input_str: hello
Traceback (most recent call last):
File "", line 1, in
a2 = input("input: ")
File "", line 1, in
NameError: name 'hello' is not defined
>>> a2 = input("input_str: ")
input_str: 'hello'
>>> print a2,type(a2)
hello
>>> b1 = raw_input("raw_input_int: ")
raw_input_int: 123
>>> print b1,type(b1)
123
>>> b2 = input("input_int: ")
input_int: 123
>>> print b2,type(b2)
123
>>> c1 = raw_input("raw_input_exp: ")
raw_input_exp: 3 + 3
>>> print c1,type(c1)
3 + 3
>>> c2 = input("input_exp: ")
input_exp: 3 + 3
>>> print c2,type(c2)
6
>>> d1 = raw_input("raw_input_sp: ")
raw_input_sp: \t
>>> print d1,type(d1)
\t
>>> d2 = input("input_sp: ")
input_sp: \t
Traceback (most recent call last):
File "", line 1, in
d2 = input("input_sp: ")
File "", line 1
\t
^
SyntaxError: unexpected character after line continuation character
>>> d2 = input("input_sp: ")
input_sp: '\t'
>>> print d2,type(d2)