The Sovereign School (Learning Unlike Any Other) Subject: Computer Science (Python) Class XII Board Questions Chapter: 1,2 and 3
The Sovereign School (Learning Unlike Any Other) Subject: Computer Science (Python) Class XII Board Questions Chapter: 1,2 and 3
The Sovereign School (Learning Unlike Any Other) Subject: Computer Science (Python) Class XII Board Questions Chapter: 1,2 and 3
3 SQP Name the Python Library modules which need to be imported to invoke the following
2019 functions:
(i) sin() –import math
(ii) (ii) randint ()-import random
4 SQP Rewrite the following code in python after removing all syntax error(s). Underline each
2019 correction done in the code.
30=to to=30
for k in range(0,to) for i in range(0,to):
if k%4==0: if k%4==0:
print (k*4) print(k*4)
else: print (k+3) else:
print(k+3)
12 SQP Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following is incorrect?
2020 a) print(T[1]) b) T[2] = -29 c) print(max(T)) d) print(len(T))
13 SQP Write a statement in Python to declare a dictionary whose keys are 1, 2, 3 and values are
2020 Monday, Tuesday and Wednesday respectively.
D={1:”Monday”,2:”Tuesday”,3:”Wednesday”}
18 2019 Write the names of any four data types available in Python.
20 2019 Rewrite the following code in python after removing all syntax
error(s). Underline each correction done in the code. 2
250 = Number
WHILE Number<=1000:
if Number=>750:
print Number
Number=Number+100
else
print Number*2
Number=Number+50
21 2019 Find and write the output of the following python code : 2
Msg1="WeLcOME"
Msg2="GUeSTs"
Msg3=""
for I in range(0,len(Msg2)+1):
if Msg1[I]>="A" and Msg1[I]<="M":
Msg3=Msg3+Msg1[I]
elif Msg1[I]>="N" and Msg1[I]<="Z":
Msg3=Msg3+Msg2[I]
else:
Msg3=Msg3+"*"
print Msg3
22 2020 Which of the following is not a valid variable name in Python ? Justify reason for it not being a
valid name.
(i) 5Radius (ii) Radius_ (iii) _Radius (iv) Radius
24 2020 Name the Python Library modules which need to be imported to invoke the following
functions :
(i) cos() (ii) randint()
25 2020 Rewrite the following code in Python after removing all syntax error(s). Underline each
correction done in the code.
input('Enter a word',W)
if W = 'Hello'
print('Ok')
else: print('Not Ok')
26 2020 Write the names of the immutable data objects from the following :
(i) List (ii) Tuple (iii) String (iv) Dictionary
27 2020 Write a Python statement to declare a Dictionary named ClassRoll with Keys as 1, 2, 3 and
corresponding values as 'Reena', 'Rakesh', 'Zareen' respectively.
28 2020 Which of the options out of (i) to (iv) is the correct data type for the variable Vowels as defined
in the following Python statement ?
Vowels = ('A', 'E', 'I', 'O', 'U')
(i) List (ii) Dictionary (iii) Tuple (iv) Array
29 2020 Write the output of the following Python code : 1 for i in range(2,7,2): print(i * '$')