You are on page 1of 4

loop.

* The while loop is an entry-controlled loop as it has a controlover entry in the loop in the form of test condition.
* Loops in Python can have else clause too. The else clause of a loop is executed in the end of the loop only when
loop terminates normally.
* The break statement can terminate a loop immediately and the control passes over to the statement following the
statement containing break.
In nested loops, a break statement terminates the very loop it appears in.
The continue statement abandons the current iteration of the loop by skipping over the rest of the statements in the
loop-body. Itimmediately transfers controlto the beginning of the next iteration of the loop.

OBJECTIVE TYPE QUESTIONS OTQs


MULTIPLE CHOICE QUESTIONS
1. Which of the following is an invalid variable ?
(a) my_day_2 (b) 2nd_day (c) Day_two (d) _2
2. Find the invalid identifier from the following: [CBSE Paper 2021 (Term 1)
(a) name (b) break (c) section (d) mark12
COMPUTE

(d)pass
30
(c)nonlocal
keyword ? (d) on
3. Which of the following is nota
(b) assert
(a) eval variable ?
cannot be a (c)it (d)Class
4. Which of the following
(b) in
init_ (a)
core data type (c) Tuples these
5. Which of these is not a none of
(b) Dictionary expression? (d)
(a) Lists
Python as dt (c)x^^y
How would you write x in
(b) x**y 13%15 (d) 0
(a) x^y 14 +
value of the expression
1. What will be the (c) 12 A
%B//A
(a) 14
(b) 27 and B=15. (d) 1
given below if A=16
8. Evaluate the expression (c)1.0
(a) 0.0 (b) 0 4/2)
(a)23
int(13.25 +
9. What is the value of x ?
X= (c) 15
expressions:
following
(b) 14 of the
(a) 17 equivalent to which
evaluate
10. The expression 8/4/2 will precedence ?
(a) 8/(4/2) (b) (8/4)/2 highest
has the
Which among the following list of operators
11. (d) %
t, **, %, /, <<, >, | (c) I
(a) <<, >> (b) ?
expressions results in an error (d) int('12.5')
12. Which of the following (c) float("12.5")
(b) int("12') below ?
(a) float(12') shown output
prints the
13. Which of the following statement
hello\example\test.txt test.txt")
(b) print("hello\ \example\ |
(a) print("hello\example\ test.txt") (d) print("hello"\example"\test.txt")
test.txt")
(c) print("hello\"example\ "
) return ?
14. Which value type does input( (c) Int
(d) Float
(a) Boolean (b) String
Python ?
Which two operators can be used on numeric values in
15. (d) #
(a) @ (b) % (c) +
fragments will yield following output ?
16. Which of the following four code
Eina
Mina
Dika
Select all of the function calls that result in this output
(a) print( 'Eina (d) print('Eina
\nMina Mina
\nDika'") Dika')
(b) print('EinaMinaDika'"')
() print('Eina\nMina\nDika' )
RLVISION JOUR
Chopter l : PYTHON 31
.-Wbich of the tollowing, is valid arithmeie operator in P'ython:
(a) // (b) ? () (d) and
1 Eor a given dvlaration in l'ython as s "WELCOME", which of the following will he the
Correct
output of printE|1:2) ?
B Paer 20121 (Term 1)|
(a) WEL () COME
(c) WLOE (d) ECM
10 Which of the tollowing is an incorect Logical operator in Python ?
CBS Paper 20121 (Term
(a) not (b) in (c) or (d) and
3 Which of the following is not a Tuple in Python ? (CBSE Paper 2021 (Term ijl
(a) (1, 2, 3) (b) ("One, "Two","Three")
() (10, ) (d) ("One")

FILL IN THE BLANKS

1. The smallest individual unit in aprogram is known as a


2. A token is also called a
3. A is a word having special meaning and role as specified by programming language.
4. The data types whose values cannot be changed in place are called types.
5. In aPython expression, when conversion of a value's data type is done automatically by the
compiler without programmer's intervention, it is called
6. The explicit conversion of an operand to a specific type is called
7. The statement is an empty statement in Python.
8. A statement skips the rest of the loop and jumps over to the statement following the loop.
9. The statement skips the rest of the loop statements and causes the next iteration of the loop
to take place.
10. Python's cannot be used as variable name.

TRUE/FALSE QUESTIONS
1. The expression int(x) implies that the variable xis converted to integer.
2. The value of the expressions 4/(3*(2-1) and 4/3*(2-1) is the same.
3. The value of the expressions 4/(3*(4-2)) and 4/3*(4-2) is the same.
4. The expression 2**2**3 is evaluated as: (2**2)**3.
5. Astring can be surrounded by three sets of single quotation marks or by three sets of double
quotation marks.
6. Variables can be assigned only Once.
7. In Python, avariable is a placeholder for data.
8. In Python, only if statement has else clause.
9. Python loops can also have else clause.
10. In anested loop, a break statement terminates all the nested loops in one go.
ASSERTIONS ANDREASONS

statementof
of reason (R).
follonedbya
DIRECTIONS nsserthon(4)
is
In tie hlone eestons. shatement of
explanatlonofA.
Mark t othor as:
true and Risthe orretcorretexplanation o
(a) BothA and Rarv nt e
tne bu Bie
hoth A and Ram true).
()A is true but Ris false (or partly
true.
() Ais talse (or partly truc) but Ris
fully true. variable internally.
() Both Aand Rare false or not creates a new
variable
an int
1. Assertion. Assigning a new Value to
Reason. The int type isimmutable data type
of Python. String.
"""A Sample Pvthon String" is a valid ryno
sserthon.
valid in Pythot.
keason. Triple Quotation marks are not
Python. statements aree in lower
3. Assertion. If and For are legal statementsin and looping
selection case
Reason. Python is case sensitive and its basic
t. Assertion. if and for are legal statements in Python. looping statements areininlower case.
selection and
Reason. Python is case sensitive and its basic selection and iteration statements.
5. Assertion. The break statement can be used with all
of a
Reason. Using break with an if statement is of no use unless the if statement is part looping construct.
statements.
break statement can be 11sed with all selection and iteration
O ASsertion. The
Reason. Using break with an if statement will give no error.

NOTE : Answers for 0TQs are qiven at the end of the book.

You might also like