Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- n = 50
- sum = 0
- count = 0
- a = [randint(0,10000) for i in range(n)]
- for i in range(len(a)):
- if a[i] % 16 == 11:
- sum += a[i]
- count += 1
- elif a[i] % 7 == 0 and (a[i] % 6 != 0 and a[i] % 13 != 0 and a[i] % 19 != 0):
- sum += a[i]
- count += 1
- print("Сумма:", sum)
- print("Количество:", count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement