Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Chapter-8

INTRODUCTION TO PYTHON
A. TICK the correct options.
1. The source code of Python is available under the ……………………..
Ans. GNU GPL
2. Which of the following is a language processor?
Ans. Interpreter
3. The Python (IDLE) consists of ………………….
Ans. (a) Python Shell window & (b) Python Edit window
4. The Python code must save with the ----------------------
Ans. .py extension
5. Which of these is a Python prompt?
Ans. >>>

B. Fill in the Blanks.


1. Python is a platform independent programming language.
2. The Python Edit window is used to write a program code containing one or multiple lines.
3. You should not put extra space in between the Python prompt and the command.
4. IDLE is a graphical integrated development environment for Python.
5. The Python Shell window shows the result of execution of a program.

C. State True or False.


1. Python is an interpreted language (True)
2. An interpreter translates the code of a program line by line. (True)
3. The Python (command line) is also called script mode of Python. (False)
4. The Python Shell window allows you to type code next to the prompt. (True)
5. The Python Edit window is a text editor. (True)

D. Match the following columns.


Ans. Column A Column B
1. Interactive mode Python (command line)
2. Script mode Python (IDLE)
3. F5 To run a program
4. Alt + F4 To exit Python
5. Ctrl + N To open a new file in Python Edit window.

E. Short answer questions.


1. What is a programming language?
Ans. A programming language is a way to instruct a computer to perform certain tasks.
2. Who created Python?.
Ans. Python was created by Guido Van Rossum at CWI (Centrum Wiskunde & informatica) in
Netherlands.
3. Write any two applications of Python.
Ans. It is easy to understand and learn for beginners. It is not limited to basic usage. In fact, it powers
some of the world’s most complex applications and websites.
4. How do you launch Python (command line)?
Ans. To start Python at the command line, click on Start . All apps Python 2.7 Python
(command line).
5. Which command and menu do you use to run a Python program?
Ans. After saving the Python program, you can execute it by following these steps.:
1. Select the Run menu
2. Click on Run Module option.

F. Long answer questions.


1. What is Python?
Ans. Python is a general purpose high-level programming language. Python is also known as an
interpreted language. Python consists of two modes: Python (command line) and Python (IDLE).
You can use any of these for programming.
2. Write any five features of Python.
Ans. Python is free. The source code of Python is available under the GNU General Public License
(GPL). It is easy to learn and use. The programs written in Python are easily readable and
understandable. It is platform independent programming language. It can used for both scientific
and non-scientific programming. It can be easily integrated with C, C++, COM, Active X,
CORBA and Java.
3. Python is an interpreted language. Justify..
Ans. It is an interpreted language,. It means programs which are written in Python are executed
directly (at runtime) and freely by the interpreter. You do not need to compile your program
before executing it. Hence, it gives immediate result..
4. What is an interpreter?
Ans. Interpreter is a language processor which converts the high level language (HLL) into machine
language (binary form, i.e. 0 and 1). It translates the code line by line. If any error is found in a
part of the code, it stops the interpretation of the code and asks you to correct the code.
5. What is the difference between interactive and script modes?
Ans. To start Python at the command line, click on Start . All apps Python 2.7 Python
(command line). The given window appears. This is called the Python (command line) window or
Python interactive mode. IDLE is a graphical integrated development environment for Python. It
contains a Python Shell. The IDLE environment is also called script mode of Python. It allows
you to edit, run, browse and debug Python programs from a single interface. This environment
makes it easy to write programs.

You might also like