aligning positive and negative numbers : Output Format « Development « Python
- Python
- Development
- Output Format
aligning positive and negative numbers

print ('% 5d' % 10) + '\n' + ('% 5d' % -10)
print ('%+5d' % 10) + '\n' + ('%+5d' % -10)
Related examples in the same category