Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python simple number formatting samples

# integer arguments
print("The number is:{:d}".format(123))

# float arguments
print("The float number is:{:f}".format(123.4567898))

# octal, binary and hexadecimal format
print("bin: {0:b}, oct: {0:o}, hex: {0:x}".format(12))
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #Python #simple #number #formatting #samples
ADD COMMENT
Topic
Name
3+8 =