When using formatting as you have, remember that in most programming languages, counting starts from scratch. Since tag2 carries only one value, the following line:
print('Second revision: {1}'.format(tag2))
Must be:
print('Second revision: {0}'.format(tag2))
You can also leave it empty for simple scripts if using python 2.7 +:
print('Second revision: {}'.format(tag2))
Or provide them in any order with named variables:
print('Second revision: {revisiontag}'.format(revisiontag=tag2))
Simon fraser
source share