0% found this document useful (0 votes)
34 views

Python Assignment 1

Python 2.x treats "print" as a statement while 3.x treats it as a function, requiring items in print to be passed in parentheses to avoid a syntax error. The Python Virtual Machine (PVM) converts bytecode instructions into machine code for the computer to execute and display output.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Python Assignment 1

Python 2.x treats "print" as a statement while 3.x treats it as a function, requiring items in print to be passed in parentheses to avoid a syntax error. The Python Virtual Machine (PVM) converts bytecode instructions into machine code for the computer to execute and display output.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1) Difference between python 2.x and 3.x.

In python 2.x, “print” is treated as a statement and python 3.x explicitly treats “print” as a function. This means we need
to pass the items inside your print to the function parentheses in the standard way otherwise you will get a syntax error.

2) What is PVM?

The role of Python Virtual Machine (PVM) is to convert the byte code instructions into machine code so that the
computer can execute those machine code instructions and display the final output.

You might also like