我正在循环几个嵌套循环。如果它发生变化,我想打印第一个循环的项目。我怎样才能做到这一点?
for slope in slopeList:
for yarddist in yardDistList:
for chiptreesperacre in chipAcreList:
for chipvolpertree in chipVolList:
for smalllognumber in smallAcreList:
for smalltreevolpertree in smallVolList:
for largelogperacre in largeAcreList:
for largetreevolpertree in largeVolList:
data = [slope, yarddist, chiptreesperacre, chipvolpertree, smalllognumber, smalltreevolpertree, largelogperacre, largetreevolpertree]
if slope changes:
print data