Advertisement
sigmachto

Untitled

Jul 2nd, 2023
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #1)
  2. print(sum(x**2 for x in range(1,101)))
  3. #Ответ:338350
  4.  
  5. #2)
  6. #Ответ: [0, 8, 16, 24, 32]
  7.  
  8.  
  9. #3)
  10. count = 0
  11. print(sum([count + 1 for x in range(20) if x % 2 == 0]))
  12. #Ответ: 10
  13.  
  14. #4)
  15. b = [64, 8, 72, 1, 56,78, 7, 59, 9, 80]
  16. print(sum([0 + 1 for x in b[::2] if x % 2 == 0]))
  17. #Ответ: 3
  18.  
  19. #5)
  20.  
  21. print(len([x for x in range(1,1000) if x % 7 == 0 or x % 11 == 0]))
  22. #Ответ: 220
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement