input: Write a Python function to transform an octal number into a decimal number.
  assert octal_to_decimal(25) == 21
  assert octal_to_decimal(30) == 24
  assert octal_to_decimal(40) == 32
output: def octal_to_decimal(octal):
      decimal = 0
      base = 1
      while octal > 0:
          last_digit = octal % 10
          octal = octal // 10
          decimal += last_digit * base
          base = base * 8
      return decimal