Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 4

No change in size, 10:40, 23 June 2017
PART 3 - String Formatting Advanced Features
print('{0:+.2f}'.format(number2))
print('{0:+.2f}\n{1:+.2f}'.format(number1, number2))
</source>In the event that the numbers being shown are all integers and do no require the decimal values, instead of using '''{:f}''',<br> use '''{:d}''' for decimal '''INTEGERSintegers'''.<br><br>
:#To demonstrate, issue the following:<source>
print('{0:d}'.format(number1))
13,420
edits