擅长:python、mysql、java
<pre><code>def divisible(x,y):
if x%y== 0:
return True
else:
return False
aList= [3, 4, 5, 6, 8, 9, 10,12]
>>> [[x for x in aList if divisible(y,x)] for y in aList]
[[3], [4], [5], [3, 6], [4, 8], [3, 9], [5, 10], [3, 4, 6, 12]]
</code></pre>