You are on page 1of 4

KENDRIYA VIDYALAYA JHAJJAR

Class -XII CS (083)


Session 2023-24
Summer break homework
—----------------------------------------------------------------------------------------------------------

Q1.). Which of the following forces an expression to be converted into a specific type?
a.) Implicit type casting
b.) Mutable type casting
c.) Immutable type casting
d.) Explicit type casting
Q2.). Which point can be considered as the difference between string and list?
a.) Length
b.) Indexing and Slicing
c. )Mutability
d. )Accessing individual elements
Q3.)Identify the valid declaration of L: L = *1, 23, ‘hi’, 6+.
(i) list
(ii) dictionary
(iii) array
(iv) tuple
Q4.) Find and write the output of the following python code:
x = "abcdef"
i = "a" while i in x:
print(i, end = " ")
Q5.) Find and write the output of the following python code:
a=10
def call():
global a
a=15
b=20
print(a)
call()
Q6.) Rewrite the following code in python after removing all syntax
error(s). Underline each correction done in the code.
30=To
for K in range(0,To)
IF k%4==0:
print (K*4)
Else:
print (K+3)
Q7.) Find and write the output of the following python code:
def fun(s):
k=len(s) m=" "
for i in
range(0,k):
if(s[i].isupper()):
m=m+s[i].lower()
elif s[i].isalpha():
m=m+s[i].upper()
else:
m=
m+'bb'
print(m)
fun('school2@com')
Q8.) Find the output of the following program:
def ChangeIt(Text,C):
T=" "
for K in range(len(Text)):
if Text[K]>='F' and Text[K]<='L':
T=T+Text[K].lower();
elif Text[K]=='E' or Text[K]=='e':
T=T+C;
elif K%2==0:
T=T+Text[K].upper()
else:
T=T+T[K-1]
print(T)
OldText="pOwERALone"
ChangeIt(OldText,"%")
(a) PPW%RRLLN%
(b) PPWCRRllNC
(c) PPW%RRllN%
(d) PpW%RrllN%
Q9.) Differentiate between global variable and local variable.
Q10.) Differentiate between call by value and call by reference
with a suitable example for each.
Q11.) Differentiate between actual parameter(s) and a formal
parameter(s) with a suitable example for each.
Q12.) What is returned by int(math.pow(3, 2))?
a) 6
b) 9
c) error,third argument required
d) error, too many arguments
Q13. )Identify the module to which the following function load ()
belong to?
a) math
b) random
c) pickle
d) sys
Q14.)What is the full form of CSV?
a. Common segregated values
b. Comma separated values
c. Common separated values
d. None of the above
Q15.) If a file is opened for writing
a. File must exist before opening
b. File will be created if does not exist
c. None of the above
d. Both a and b
Q16.) Which one of the following is the correct statement?
a. import – pickle
b. pickle import
c. import pickle
d. All the above
Q17. )Which of the following file mode opens a file for append or read a
binary file and moves the files pointer at the end of the file if the file
already exist otherwise create a new file?
a. a
b. ab
c. ab+
d. A+
Q18.)Project based learning
a.) Project synopsis/documentation
b.) Project coding / implementation
Topics are : Restaurant billing system (search nearby your location),
Hospital management, Railway reservation system, shopping mall billing system,
Development of a Puzzle,Development of an educational game. Etc.
Q19.) Write at least 10 programs of user defined functions in a practical file .
Q20.Useful Self -study links:
http://python.mykvs.in/index.php
https://python4csip.com/
https://www.w3schools.com/
https://cbseacademic.nic.in/qbclass12.html
https://ncert.nic.in/textbook.php?lecs1=0-13
Commonly made mistakes by students in this unit :
❖ Students find it difficult to write code related to file handling.
❖ Students are confused in randint() and randrange() functions.
❖ Students need practice in solving output questions related to strings.
❖ Students make mistakes in writing values of local variables and global
variables
in function output questions.
Tips for students :
❖ Revise the concept of lists and strings thoroughly to solve output questions.
❖ Do written practice of some important lines of code like code to write an
object to a binary file and reading from a binary file.
❖ Don't cram code.Try to understand.
❖ Revise use of split function,use of for loop in reading text file thoroughly.
“If you are not willing to learn ,no one can help you.
If you are determined to learn ,no one can stop you. “

You might also like