Built-In Functions

The Python interpreter has a number of functions and types built into it that are always available.

value = 65
print(bin(value))    # 0b1000001
print(oct(value))    # 0o101
print(hex(value))    # 0x41
print(chr(value))    # A

value = 1234.567
print(round(value, 1))          # 1234.6
print(format(value, ",.2f"))    # 1,234.57

results matching ""

    No results matching ""