We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4928201 commit 7702faeCopy full SHA for 7702fae
array_pair_divisble_by_5.py
@@ -1,13 +1,18 @@
1
from itertools import combinations
2
def array_pairs(x):
3
z=[]
4
+ count=0
5
l=list(combinations(x,2))
6
for i in l:
- if (int(i[0])+int(i[1])) % 5 == 0:
7
+ a=int(i[0])+int(i[1])
8
+ if a%5 == 0:
9
+ if a%2==0:
10
+ count+=1
11
z.append(i)
-
- return z
12
+
13
+ print(z)
14
+ print(count)
15
16
if __name__ == "__main__":
17
x= input().split()
- print(array_pairs(x))
18
+ array_pairs(x)
0 commit comments