Next / Previous / Contents / TCC Help System / NM Tech homepage

13.24. oct(): Convert to base 8

Given a number n, oct(n) returns a string containing an octal (base 8) representation of n. Consistent with Python's convention that any number starting with a zero is considered octal, the result of this function will always have a leading zero.

>>> oct(0)
'0'
>>> oct(127)
'0177'