Advertisement
1nikitas

Untitled

Mar 3rd, 2022
1,158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. from random import randint
  2. n = 50
  3. sum = 0
  4. count = 0
  5. a = [randint(0,1000) for i in range(n)]
  6. for i in range(len(a)):
  7.     if a[i] % 16 == 11:
  8.         sum += a[i]
  9.         count += 1
  10.     elif a[i] % 7 == 0 and (a[i] % 6 != 0 and a[i] % 13 != 0 and a[i] % 19 != 0):
  11.         sum += a[i]
  12.         count += 1
  13. print("Сумма:", sum)
  14. print("Количество:", count)
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement