Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #2
- a = [2,4,5,8,10]
- f = list(map(lambda i: i**3,a))
- print(f)
- #Ответ:[8, 64, 125, 512, 1000]
- #3)
- L1 = [-1,4,-7,-8,-10,1,0]
- f = list(filter(lambda x: x < 0,L1))
- print(f)
- #Ответ:[-1, -7, -8, -10]
- #4)
- from functools import reduce
- L1 = [x for x in range(1,int(input())+1)]
- f = reduce(lambda x,y: x * y,L1)
- print(f)
- #Ответ: 40320
- #5)
- L1 = [2, 4, 6, 8, 0, 3, 4, 2, 3, 5, 1,2]
- f = list(filter(lambda x: x**2 % 9 == 0, L1))
- print(max(f))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement