counts=dict(A=dict(),B=dict())
for n in range(0,6): Fn='F'+str(n)
counts['A'][Fn]=n
counts['B'][Fn]=-nThen counts =
{'A': {'F0': 0, 'F1': 1, 'F2': 2, 'F3': 3, 'F4': 4, 'F5': 5}, 'B': {'F0': 0, 'F1': -1, 'F2': -2, 'F3': -3, 'F4': -4, 'F5': -5}} That is:
for t in ('A','B'):
for n in range(0,6):
Fn='F'+str(n)
print("counts[%s][%s]=%d" % (t,Fn,counts[t][Fn]))
will print
counts[A][F0]=0counts[A][F1]=1counts[A][F2]=2counts[A][F3]=3counts[A][F4]=4counts[A][F5]=5counts[B][F0]=0counts[B][F1]=-1counts[B][F2]=-2counts[B][F3]=-3counts[B][F4]=-4counts[B][F5]=-5
No comments:
Post a Comment