Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1)
- print(sum(x**2 for x in range(1,101)))
- #Ответ:338350
- #2)
- #Ответ: [0, 8, 16, 24, 32]
- #3)
- count = 0
- print(sum([count + 1 for x in range(20) if x % 2 == 0]))
- #Ответ: 10
- #4)
- b = [64, 8, 72, 1, 56,78, 7, 59, 9, 80]
- print(sum([0 + 1 for x in b[::2] if x % 2 == 0]))
- #Ответ: 3
- #5)
- print(len([x for x in range(1,1000) if x % 7 == 0 or x % 11 == 0]))
- #Ответ: 220
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement