Python | Compiled or Interpreted ? Last Updated : 24 Apr, 2025 Comments Improve Suggest changes 40 Likes Like Report Please note that Python language standard does not specify whether the code is to be compiled or interpreted or both. It depends upon the implementation or distribution of a Python language. The most common implementations of Python like CPython do both compilation and interpretation. The compilation part is hidden from the programmer thus, many programmers believe that it is an interpreted. The compilation part is done first to convert the given Python code (or .py) to a byte code. Then this byte code gets converted by the python virtual machine(p.v.m) according to the underlying platform(machine+operating system). Now the question is - if there is any proof that it first compiles the program internally and then run the code via interpreter? The answer is yes! and note this compiled part is get deleted by the python(as soon as you execute your code) just it does not want programmers to get into complexity. Code : Sample Python code Python3 1== print("i am learning python") print("i am enjoying it") now if you run this code using command prompt just save this above code in notepad and save with the extension ".py" syntax: python (name of the program.py) and press enter. Note: If you are writing code in the notepad just save the code with extension "py" inlet suppose you have created a folder named python_prog in d drive. as you press enter the byte code will get generated. A folder created and this will contain the byte code of your program. This folder is in the python_prog folder where you will save your python codes. now to run the compiled byte code just type the following command in the command prompt:- the extension .pyc is python compiler.. Thus, it is proven that python programs are both compiled as well as interpreted!! but the compilation part is hidden from the programmer. Create Quiz Comment U UdikshaSolanki Follow 40 Improve U UdikshaSolanki Follow 40 Improve Article Tags : Python Explore Python FundamentalsPython Introduction 2 min read Input and Output in Python 4 min read Python Variables 4 min read Python Operators 4 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 5 min read Python Functions 5 min read Recursion in Python 4 min read Python Lambda Functions 5 min read Python Data StructuresPython String 5 min read Python Lists 4 min read Python Tuples 4 min read Python Dictionary 3 min read Python Sets 6 min read Python Arrays 7 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 5 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 3 min read Python MySQL 9 min read Python Packages 10 min read Python Modules 3 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 3 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 4 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 3 min read StatsModel Library - Tutorial 3 min read Learning Model Building in Scikit-learn 6 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 6 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 7 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 5 min read Build a REST API using Flask - Python 3 min read Building a Simple API with Django REST Framework 3 min read Python PracticePython Quiz 1 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like