Name: Anonymous 2011-09-13 17:53
I'm trying to format my output so that everything lines up properly along the left side. I'm also rounding everything to 2 decimal places. The decimals are fine, however there isn't a proper number of spaces between Length and then the value.
print('Length: %10.2f' % length)
print('Width: %10.2f' % width)
What I want:
Length: 20.22
Width: 40.23
I realize this may seem like a very elementary question, but I've given myself a headache over the last hour trying to do this myself.
print('Length: %10.2f' % length)
print('Width: %10.2f' % width)
What I want:
Length: 20.22
Width: 40.23
I realize this may seem like a very elementary question, but I've given myself a headache over the last hour trying to do this myself.