I've to create a set which is the all sum of all combinations of three coins that are dividable by 65. what I have so far is the following:
my code so far:
set([x + y + i for x in coins for y in coins for i in coins if (x+y+i)%65])
the outcome has to be:
set(result) == {65, 130, 260}
You need to see if the modulus equals zero (there is no remainder left).
m = set([x + y + i for x in coins for y in coins for i in coins if (x+y+i)%65==0])
print(m)
>>> {65, 130, 260}