1.if 表达式的1
fib = lambda n: 1 if n ==0 or n == 1 else fib(n-1) + fib(n-2)
2.print的*
for i in range(5):
print('*'*(i+1))
3.yeild from
yeild from f
for line in f:
yeild line
4.pdb调试
import pdb; pdb.set_trace()
fib = lambda n: 1 if n ==0 or n == 1 else fib(n-1) + fib(n-2)
for i in range(5):
print('*'*(i+1))
yeild from f
for line in f:
yeild line
import pdb; pdb.set_trace()
转载于:https://my.oschina.net/charlock/blog/760666