13,420
edits
Changes
→PART 3 - String Formatting Advanced Features
number2 = -50
number3 = 1.50
print('{0:f}'.format(number1)) # The "0 " is the position just like other format() functionsprint('{0:f}'.format(number2)) # The A colon separate the postionposition/index areas from the extra functionalityprint('{0:f}'.format(number3)) # The "f stands for " represents the fixed point number
</source>
:#A fixed point number means that it can control the number of digits that come after the decimal point, try changing the '''.2''' to any other number and experiment<source>