How to convert octal to decimal in Python

2 Answers

0 votes
octal = 17

decimal = int(str(octal), 8)

print(decimal)



'''
run:
  
15
  
'''

 



answered Nov 2, 2021 by avibootz
0 votes
octal = "17"

decimal = int(octal, 8)

print(decimal)



'''
run:
  
15
  
'''

 



answered Nov 2, 2021 by avibootz

Related questions

1 answer 114 views
1 answer 152 views
1 answer 133 views
133 views asked Jul 23, 2022 by avibootz
1 answer 128 views
128 views asked Jul 23, 2022 by avibootz
1 answer 185 views
...