Discuss / Python / work 2

work 2

Topic source

程乔静

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

def prod(L): def f(x,y): return x*y return reduce(f,L)

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

测试成功!


  • 1

Reply