Advertisement
Farz0l1x

Untitled

Dec 3rd, 2023
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. from random import randint
  2. A = [randint(1, 100) for i in range(100)]
  3. count = 0
  4. for i in range(len(A)):
  5.     for j in range(i + 1, len(A)):
  6.         if (A[i] * A[j]) % 7 == 0:
  7.             count += 1
  8. print(count)
  9.  
  10. k7 = 0
  11. for i in range(len(A)):
  12.     if A[i] % 7 == 0:
  13.         k7 += 1
  14. k = len(A) - 7
  15. print(k * k7 + k7 * (k7 - 1) // 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement