Python Byte Code

Let's consider the following Python program:

#Python program to add two numbers
a = b = 10
#take two variables and store 10 in to them
print("Sum=", (a+b)) #display their sum

We can type this program in a text editor like Notepad and then save it as 'first.py'. It means, the first.py file contains the source code

Now, let's compile the program using Python compiler as

C:\>python first.py
It will display the result as: sum=20

That is ok. But we do not want the output of the program. We want to see the byte code instructions that were created internally by the Python compiler before they are executed by the PVM. For this purpose, we should specify the dis module while using python command as:
C:\>python -m dis first.py

It will produce the following output: