print '%d:%02d' % divmod(10,20)
results in what I want:
0:10
However
print '%s %d:%02d' % ('hi', divmod(10,20))
results in:
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
print '%s %d:%02d' % ('hi', divmod(10,20))
TypeError: %d format: a number is required, not tuple
How do I fix the second print statement so that it works?
I thought there was a simpler solution than
m = divmod(10,20)
print m[0], m[1]
or using python 3 or format().
I feel I'm missing something obvious