🔁 Decimal to Octal Conversion in Python
🔸 Method #1: Use Python’s built-in function oct()
Just use the oct() function to convert any decimal number to octal.
x = 25
print(oct(x))
🧠 Output:
0o31
👉 The result is Octal 31, and 0o is just a prefix to show “this is octal.”
🔸 Method #2: M...
safiakhatoon.hashnode.dev2 min read