I have part of code that looks like this:
for i in [0,1]:
...
print('{} used {} words that {} did not use.'.format(a[i], 50 , a[i+1]))
For the first iteration, I want it to do,
print('{} used {} words that {} did not use.'.format(a[0], 50 , a[1]))
but for the second iteration, I want this:
print('{} used {} words that {} did not use.'.format(a[1], 50 , a[0]))
How can this be done?
1 - iis one option.(i+1)%2is anotheri ^ 1also works[0,1,2,3,4]? Or, Eric, is[0,1]the only case you want to handle? If so, why not just write twoprint()statements and be done with it?