Advertisement
denvolf2000

Задача 2

Dec 16th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. from random import randint
  2. A =  [randint(0, 100) for i in range(25)]
  3. print(A) #для проверки
  4. count = 0
  5. for i in range(len(A) - 1):
  6.     if A[i] % 3 == 2 and A[i] // 3 % 3 == 1 or A[i + 1] % 3 == 2 and A[i + 1] // 3 % 3 == 1:
  7.         print(A[i], A[i + 1]) #для проверки
  8.         count += 1
  9. print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement