Discuss / Python / 练习二

练习二

Topic source

霸下

#1 Created at ... [Delete] [Delete and Lock User]

from functools import reduce def prod(L): return reduce(a,L) def a(x,y): return x*y

print('3 5 7 * 9 =', prod([3, 5, 7, 9])) if prod([3, 5, 7, 9]) == 945: print('测试成功!') else: print('测试失败!')


  • 1

Reply