You are on page 1of 2

PYTHON PROGRAMMING LANGUAGE

SIARGAO ISLAND INSTITUTE OF TECHNOLOGY


ASSIGNMENT

1. What is a compiler?
Ans: A compiler translates the source code to target code. They translate a program written in a
high-level language into a low-level language all at once, in preparation for later execution.
2. What is an interpreter?
Ans: Execute a program in a high-level language by translating it one line at a time. Typically
generate an efficient intermediate representation and immediately evaluate it.
3. How is a compiler similar to an interpreter? How are they different?
Ans: Interpreters and compilers are very similar in structure. The main difference is that an
interpreter directly executes the instructions in the source programming language while a
compiler translates those instructions into efficient machine code.
4. How is compiled or interpreted code different from source code?
Ans: Source code is the text file that contains the program in some programming language
intended for consumption by humans. It cannot be executed natively by the computer’s CPU. It
has to be compiled or interpreted first, where compiled code is object code in either native CPU
instructions (like compiled C/C++ code) or some type of byte code that runs in a virtual machine
(like Java bytecode).
5. What tool does a programmer use to produce Python source code?
Ans: Programmers using tools such as editors, compilers, interpreters, debuggers, and profilers
to produce source code.
6. What is necessary to execute a Python program?
Ans: Typing commands directly in python shell (IDLE’s interactive shell) then enter the
program into IDLE’s editor, save it, and run it.

7. List several advantages developing software in a higher-level language has over developing
software in machine language.
Ans:
1. High level languages are programmer friendly. They are easy to write, debug and maintain.
2. It provide higher level of abstraction from machine languages.
3. It is machine independent language.
4. Easy to learn.
5. Less error prone, easy to find and debug errors.
6. High level programming results in better programming productivity.

8. How can an IDE improve a programmer’s productivity?


Ans: Integrated development environments(IDE) are designed to maximize programmer
productivity by providing tight-knit components with similar user interfaces. IDEs present a
single program in which all development is done. This program typically provides many features
for authoring, modifying, compiling, deploying and debugging software. This contrasts with
software development using unrelated tools, such as vi, GCC or make.

9. What the “official” Python IDE?


Ans:  The official python IDE is IDLE used for editing and running Python programs.
10. What is a statement in a Python program?
Ans: A statement is a command that the interpreter executes. A statement is the fundamental unit
of execution in a Python program. Statements may be grouped into larger chunks called blocks,
and blocks can make up more complex statements.

You might also like