With this example, you can get to know the conversion between octal and decimal in Python.
Source Code
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
n = 0
p = input('Please input a octal number: ')
for i in range(len(p)):
n = n * 8 + ord(p[i]) - ord('0')
print('Converted decimal number:')
print(n)
Output:
Please input a octal number: 12
Converted decimal number:
10