LOGO
  • Follow Us
  • C#
  • OOP
  • ASP.NET Core
  • MVC
  • TypeScript
  • Angular
  • Python
  • SQL Server
  • MongoDB
  • More
    ✕
    .NET Tutorials
    • C#
    • C# OOP
    • ASP.NET Core
    • ASP.NET MVC
    • IoC
    • Web API
    • LINQ
    Client Side
    • JavaScript
    • jQuery
    • Node.js
    • D3.js
    • TypeScript
    • Angular 11
    • AngularJS 1
    • Sass
    Server Side
    • Go lang
    • Python
    • https
    • SQL
    • SQL Server
    • PostgreSQL
    • MongoDB
    Skill Tests
    • ASP.NET Core
    • ASP.NET MVC
    • LINQ
    • C#
    • web api
    • IoC
    • TypeScript
    • AngularJS
    • Node.js
    • jQuery
    • JavaScript
  • Articles
  • Tests
  • Python Tutorials
  • Python - Get Started
  • What is Python?
  • Where to use Python?
  • Python Version History
  • Install Python
  • Python - Shell/REPL
  • Python IDLE
  • Python Editors
  • Python Syntax
  • Python Keywords
  • Python Variables
  • Python Data Types
    • Number
    • String
    • List
    • Tuple
    • Set
    • Dictionary
  • Python Operators
  • Python Conditions - if, elif
  • Python While Loop
  • Python For Loop
  • User Defined Functions
    • Lambda Functions
  • Variable Scope
  • Python Modules
    • Module Attributes
  • Python Packages
  • Python PIP
  • __main__, __name__
  • Python Built-in Modules
    • OS Module
    • Sys Module
    • Math Module
    • Statistics Module
    • Collections Module
    • Random Module
  • Python Generator Function
  • Python List Comprehension
  • Python Recursion
  • Python Built-in Error Types
  • Python Exception Handling
  • Python Assert Statement
  • Define Class in Python
  • Inheritance in Python
  • Python Access Modifiers
  • Python Decorators
    • @property Decorator
    • @classmethod Decorator
    • @staticmethod Decorator
  • Python Dunder Methods
  • CRUD Operations in Python
  • Python Read, Write Files
  • Regex in Python
  • Create GUI using Tkinter
  • Python Learning Resources
  • Python API Methods
  • Python Built-in Methods
  • Python String Methods
  • Python List Methods
  • Python Set Methods
  • Python Dictionary Methods

Python - oct()

The octal() converts a decimal integer in octal representation with 0o prefix.

>>>oct(12)
'0o14'
>>>oct(10)
'0o12'
>>>oct(8)
'0o10'
>>>oct(-23)
'-0o27'
Python Questions & Answers
Start Python Skill Test
Related Articles
  • Compare strings in Python
  • Convert file data to list
  • Convert User Input to a Number
  • Convert String to Datetime in Python
  • How to call external commands in Python?
  • How to count the occurrences of a list item?
  • How to flatten list in Python?
  • How to merge dictionaries in Python?
  • How to pass value by reference in Python?
  • Remove duplicate items from list in Python
  • More Python articles

  • Python Questions & Answers
  • Python Skill Test
  • Python Latest Articles
TutorialsTeacher.com

TutorialsTeacher.com is optimized for learning web technologies step by step. Examples might be simplified to improve reading and basic understanding. While using this site, you agree to have read and accepted our terms of use and privacy policy.

  • Contact Us
Tutorials
  • ASP.NET Core
  • ASP.NET MVC
  • IoC
  • Web API
  • C#
  • Object-Oriented C#
  • LINQ
  • Python
  • Go Lang
  • SQL
  • SQL Server
  • MongoDB
  • PostgreSQL
  • Entity Framework
  • JavaScript
  • jQuery
  • Typescript
  • Node.js
  • Angular 2
  • D3.js
  • Sass
  • Https (SSL)
  • AngularJS 1
E-mail list

Subscribe to TutorialsTeacher email list and get latest updates, tips & tricks on C#, .Net, JavaScript, jQuery, AngularJS, Node.js to your inbox.

We respect your privacy.

  • HOME
  • TERMS OF USE
  • PRIVACY POLICY
2023 TutorialsTeacher.com. All Rights Reserved.