0
def getAromaticProportion(m) :
  aromatic_list = [m.GetAtomWithIdx(i).GetIsAromatic() for i in range(m.GetNumAtoms())]
  print(aromatic_list)
  aromatic = 0
  for i in aromatic_list:
    if i==True:
      aromatic+=1
  heavy_atom = Descriptors.HeavyAtomCount(m)
  return aromatic/heavy_atom

Can someone explain me, Which kind of loop is this aromatic_list = [m.GetAtomWithIdx(i).GetIsAromatic() for i in range(m.GetNumAtoms())]

I know the normal for loop i.e. for x in range(6). But why there is starting statement before a loop i.e. m.GetAtomWithIdx(i).GetIsAromatic()

Arham Shah
  • 25
  • 5

0 Answers0