Octal Conversion in Python

Level 114 keystrokes

This converts an integer to its octal representation using the oct() function.

Python code

# oct() converts an integer to an octal string starting with 0o
# 64 is 8 × 8, which is 100 in octal, so 0o100 is printed
1print(oct(64))

Output

0o100
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Python code and how often they appear.

  • (× 2
  • )× 2

More Python examples at level 1

← Python typing practice