Please put me out of my misery. The following example seems to be using y twice rather than y and then m.
>>> m=8 >>> y=11 >>> print '20{0:02d}{0:02d}01'.format(y, m) 20111101 I've been through as much of the documentation as I can but can't figure out what would have been relatively straightforward with the old procedure:
>>> print '20%02d%02d01' % ( y, m ) 20110801 If someone could explain where I'm going wrong I'd be really grateful.
'20{0:02d}{0:02d}01'should be'20{0:02d}{1:02d}01''20{:02d}{:02d}01'