import itertools
atoms = ['a','b','c','d','h']
for atom1, atom2 in itertools.combinations(atoms, 2):
print(atom1,atom2)
output:
a b
a c
a d
a h
b c
b d
b h
c d
c h
d h
itertools.combinations()测试
最新推荐文章于 2024-01-11 17:45:42 发布
import itertools
atoms = ['a','b','c','d','h']
for atom1, atom2 in itertools.combinations(atoms, 2):
print(atom1,atom2)
output:
a b
a c
a d
a h
b c
b d
b h
c d
c h
d h