Skip to content

Commit 7702fae

Browse files
committed
array code
1 parent 4928201 commit 7702fae

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Diff for: array_pair_divisble_by_5.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
from itertools import combinations
22
def array_pairs(x):
33
z=[]
4+
count=0
45
l=list(combinations(x,2))
56
for i in l:
6-
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
711
z.append(i)
8-
9-
return z
12+
13+
print(z)
14+
print(count)
1015

1116
if __name__ == "__main__":
1217
x= input().split()
13-
print(array_pairs(x))
18+
array_pairs(x)

0 commit comments

Comments
 (0)