对着书上的代码在Python的IDLE中输入一下代码
#Python 3.3.2 (v3.3.4:7ff62415e426, Feb 10 2014, 18:12:08) [MSC v.1600 32 bit (Intel)] on win32
#Type "copyright", "credits" or "license()" for more information.
>>>def print_lol(the_list):
for each_item in the_list:
if isinstance(each_item,list):
print_lol(each_item)
else:
print(each_item)
结果报语法错误,查了半天原来是IDLE中自带的>>> 不能作为模块文件来运行。
P.S 尽早把错误犯完!