#Then add any other numbers that were sent.
for num in nums:
sum = sum + num
# Print the results.
print("The sum of your numbers is %d." % sum)
example_function(1,2)
example_function(1,2,3)
example_function(1,2,3,4)
example_function(1,2,3,4,5)
12、.map函数:需要对列表中每个元素做一个相同的处理,得到新列表
#map(),filter() reduce()结合lambda表达式
print(list(map( lambda x: x+x, [y for y in range(10)])))
print(list(map( lambda a, b: a+b,[x for x in range(10)],[y for y in range(10)])))
print(list(filter( lambda a: a & 1 ==0 , [x for x in range(10)])))
print(reduce(lambda x,y : x*y , [a for a in range(1,10)]))
14、time()函数