12th Computer Science Model Question Paper English Medium PDF Download
12th Computer Science Model Question Paper English Medium PDF Download
A |2019-2020
COMPUTER SCIENCE
www.Padasalai.Net www.Trb Tnpsc.com
UNIT - II
6. CONTROL STRUCTURE
Choose the best answer :
1. How many important control structures are there in Python?
A) 3 B) 4 C) 5 D) 6
2. elif can be considered to be abbreviation of
A) nested if B) if..else C) else if D) if..elif
3. What plays a vital role in Python programming?
A) Statements B) Control C) Structure D) Indentation
et
4. Which statement is generally used as a placeholder?
A) continue B) break C) pass D) goto
i.N
5. The condition in the if statement should be in the form of
A) Arithmetic or Relational expression
B) Arithmetic or Logical expression
la
C) Relational or Logical expression
D) Arithmetic sa
6. Which is the most comfortable loop?
A) do..while B) while C) for D) if..elif
da
7. What is the output of the following snippet?
i=1
while True:
Pa
if i%3 ==0:
break
print(i,end='')
w.
i +=1
A) 12 B) 123 C) 1234 D) 124
ww
et
Sequential
Alternative or Branching
i.N
Iterative or Looping
la
flows to the statement immediately after the body of the loop.
When the break statement is executed, the control flow of the program comes
sa
out of the loop and starts executing the segment of code after the loop structure.
else:
statements-block 2
w.
kindly send me your key Answers to our email id - [email protected]
2|Pa g e
DINESH .A |2019-2020
62 www.Padasalai.Net www.Trb Tnpsc.com
Part - III
Answer the following questions (3 marks)
et
For j in range (65, i + 1):
print (chr(j), end = ' ')
i.N
print (end='\n')
i+ = 1
la
2. Write note on if..else structure.
When we need to construct a chain of if statement(s) then 'elif' clause can be used
instead of 'else'.
sa
Syntax:
da
if <condition-1>:
statements-block 1
elif <condition-2>:
statements-block 2
Pa
else:
statements-block n
In the syntax of if..elif..else mentioned above, condition-1 is tested if it is true
w.
et
Part - IV
Answer the following questions (5 marks)
i.N
1. Write a detail note on for loop
for loop is the most comfortable loop.
la
It is also an entry check loop.
The condition is checked in the beginning and the body of the loop(statements-
sa
block1) is executed if it is only True otherwise the loop is not executed.
Syntax:
for counter_variable in sequence:
da
statements-block 1
[else: # optional block
statements-block 2]
The counter_variable mentioned in the syntax is similar to the control variable
Pa
that we used in the for loop of C++ and the sequence refers to the initial, final and
increment value.
The syntax of range() is as follows:
w.
range (start,stop,[step])
start – refers to the initial value
stop – refers to the final value
ww
et
is true statements-block2 is executed and even if it fails statements-block n
mentioned in else part is executed.
i.N
la
sa
da
Pa
w.
Example :
#Program to illustrate the use of nested if statement
Average Grade
>=80 and above A
>=70 and <80 B
>=60 and <70 C
>=50 and <60 D
Otherwise E
m1=int (input("Enter mark in first subject : "))
et
Output 1:
Enter mark in first subject : 34
Enter mark in second subject : 78
i.N
Grade : D
Output 2 :
Enter mark in first subject : 67
la
3. Write a program to display all 3 digit odd numbers.
for i in range (101, 100, 2):
sa
print (i, end = " ")
PREPARED BY
DINESH.A
THIRUVANNAMALAI
CONTACT : 9025226740