Advertisement
sigmachto

Untitled

Jul 10th, 2023
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. #2
  2.  
  3. a = [2,4,5,8,10]
  4. f = list(map(lambda i: i**3,a))
  5. print(f)
  6. #Ответ:[8, 64, 125, 512, 1000]
  7.  
  8. #3)
  9. L1 = [-1,4,-7,-8,-10,1,0]
  10. f = list(filter(lambda x: x < 0,L1))
  11. print(f)
  12. #Ответ:[-1, -7, -8, -10]
  13.  
  14. #4)
  15. from functools import reduce
  16. L1 = [x for x in range(1,int(input())+1)]
  17. f = reduce(lambda x,y: x * y,L1)
  18. print(f)
  19. #Ответ: 40320
  20. #5)
  21. L1 = [2, 4, 6, 8, 0, 3, 4, 2, 3, 5, 1,2]
  22. f = list(filter(lambda x: x**2 % 9 == 0, L1))
  23. print(max(f))
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement