摘要: exec 'print "Hello World"'Hello World eval语句用来计算存储在字符串中的有效Python表达式。下面是一个简单的例子 阅读全文
posted @ 2016-04-06 11:57 gopher-lin 阅读(211) 评论(0) 推荐(0) 编辑
摘要: import functools def add(a, b): return a + b add(4, 2) 6 plus3 = functools.partial(add, 3) plus5 = functools.partial(add, 5) plus3(4) 7 plus3(7) 10 plus5(10) 15 阅读全文
posted @ 2016-04-06 11:56 gopher-lin 阅读(126) 评论(0) 推荐(0) 编辑