{"id":19465,"date":"2021-08-30T16:06:27","date_gmt":"2021-08-30T10:36:27","guid":{"rendered":"https:\/\/python-programs.com\/?p=19465"},"modified":"2021-11-22T18:36:30","modified_gmt":"2021-11-22T13:06:30","slug":"python-program-to-convert-octal-to-hexadecimal","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-convert-octal-to-hexadecimal\/","title":{"rendered":"Python Program to Convert Octal to Hexadecimal"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Convert Decimal to Hexadecimal<\/a>
\nGiven an octal number and the task is to get the respective hexadecimal number.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Octal number = 24<\/pre>\n

Output:<\/strong><\/p>\n

The Hexadecimal value of the given octal number { 24 } is: \r\n14<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given Octal number = 72<\/pre>\n

Output:<\/strong><\/p>\n

The Hexadecimal value of the given octal number { 72 } is: \r\n3A<\/pre>\n

Program to Convert Octal to Hexadecimal in Python<\/h2>\n

Below are the ways to convert the given octal\u00a0number into hexadecimal :<\/p>\n