Advertisement
imariia777

Untitled

Sep 2nd, 2023
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. #H/W
  2. #1
  3. #Женя, Вася
  4. D = {'Женя': 89, 'Вася': 100, 'Марк': 71, 'Мария': 79}
  5. f = list(filter(lambda x: D[x] > 80, D))
  6. print(f)
  7.  
  8. #2
  9. L = map(int, input().split())
  10. f = list(map(lambda x: x**3, L))
  11. print(f)
  12. #[8, 64, 216, 512, 1000]
  13.  
  14. #3
  15. L = map(int, input().split())
  16. f = list(filter(lambda x: x < 0, L))
  17. print(f)
  18. #[-1, -7, -8, -10]
  19.  
  20. #4
  21. from functools import reduce
  22. L1 = [1, 2, 3, 4, 5, 6, 7, 8]
  23. f = reduce(lambda x, y: x * y, L1)
  24. print(f)
  25. #40320
  26.  
  27. #5
  28.  
  29. L1 = map(int, input().split())
  30. # L2 = (i**2 for i in L1)
  31. f = filter(lambda x: ((x ** 2) % 9) == 0, L1)
  32. g = max(f)
  33. print((g))
  34. #6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement