PYTHON
EXERCISE
A. Tick ( ) the correct answer.
1. Who created Python in late 1980s?
a) Guido von Rosum b) Guido van Rossum c) Monty Python
2. The primary prompt in Python is ___________.
a) >>> b) >> c) >=
3. Python is processed at run time by a/an ____________.
a) compiler b) assembler c) interpreter
4. ____________ is the grammar of a programming language.
a) Syntax b) Syntax Error c) Virus
5. Syntax Error is also known as ____________.
a) Worm b) Virus c) Bug
B. Fill in the blanks.
1. In Python, you can save program in script mode.
.py extension.
3. Print mode in Python is used to create souce code.
4. Comments start with # sign.
5. F5 is the shortcut key to run a program in Python.
C. Write True (T) or False (F).
1. Python is a case sensitive language.
2. In Python, anything written after # is printed as it is.
3. Script mode performs as a calculator is Python.
4. Python uses ( \ ) character to denote that a line should continue.
5. You can save program in the Interactive mode of Python IDLE.
A. Python was developed by Guido van Rossum.
16
A. IDLE is an acronym of Integrated Developement Environment.
A. print ( ) function displays the result.
A. Interactive Mode,as the name suggests, allows to interact with OS. It is convenient for the
beginners to work and for testing codes.
more than few lines, so as to save the code, modify and reuse it.
A. Print() function evaluates the expression before printing it on the monitor. It is a function,
entire line and then goes to next line for subsequent output (s).
A.
ii) It allows editing and running program from a single interface.
iii) Interactive environment makes it easy to write program.
A.
ignored by interpreter, i.e. it will not have any effect on the program. A comment can
appear on a line by itself or they can also be at the end of line.
1. >>> print 20 + 40
A.
A.
A.
A. Print (177/7)
A. Script Mode.
17
Mr. A , Mr. B, Mr. C and Mr. D are four teachers of a school. Mr. A can teach English as
well as Maths but not Hindi. Mr. B can teach English only. Mr. C can teach English as well
A B C D
English
Hindi
Maths
a) 2 b) 3 c) 4
2. How many teachers can teach English?
a) 2 b) 3 c) 4
a) Maths b) English c) Hindi
18