Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
117 views
13 pages
Sample Paper
Uploaded by
jnvmandlappc2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Sample Paper For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
117 views
13 pages
Sample Paper
Uploaded by
jnvmandlappc2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Sample Paper For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Sample Paper For Later
You are on page 1
/ 13
Search
Fullscreen
Sample Question Paper Class: Xil Session: 2021-22 Computer Science (Code 083) (Theory: Term-1) Maximum Marks: 35, Time Allowed: 90 Minutes General Instructions: The question paper is divided into 3 Sections - A, B, and C. Section A consists of 25 Questions (1-25). Attempt any 20 questions. Section B consists of 24 Questions (26-49). Attempt any 20 questions. Section C consists of 6 case study based Questions (50-55). Attempt any 5 questions. All questions carry equal marks. Qu. Section-A This section consists of 25 Questions (1 to 25). Attempt any 20 questions from this section. Choose the best possible option. 1 Find the invalid identifier from the following a, none b. address c. Name d. pass 2 | Consider the declaration L = 7, ‘Python’, ‘3.14", What will be the data type of L? a. list b. tuple c. dictionary d. string 3 | Given an object obj1= (10, 20, 30, 40, 50, 60, 70, 80, 90). What will be the output of print(obj1[3:7:2])? a, (40,50,60,70,80) b. (40,50,60,70) c. (40,50,60) (40,60) 4 | Which of the following statements is not correct? a. If we try to read a text file that does not exist, an error occurs. b. If we try to read a text file that does not exist, the file gets created c. If we try to write on a text file that does not exist, no error occurs. d. If we try to write on a text file that does not exist, the file gets created 5 [Which of the following options can be used to read the first line of a text file "Myfile.txt"? a. myfile = open(‘Myfile.txt’); print(myfile.read(line)) b. myfile = open(‘Myfile.tet'r); print(myfile.read(1)) c. myfile = open('Myfile.txt’); print(myfile.readiine()) d. myfile = open(‘Myfile.tet); print(myfile.readiines())Assume that the position of the file pointer is at the beginning of 3rd line in a text file. Which of the following options can be used to read all the remaining lines? a. myfile.read(n-3) b. myfile.read(n) c. myfile readline() d, myfile.readlines() Atextfile "student. Ext” is stored in the storage device. Identify the correct option out Of the following options to open the file in read mode, i. myfile = open(student.tet’‘a’ ii. myfile = open('student.txt,'w) il, myfile = open('student.txt’’) iv. myfile = open('student.bct’) a. only i b. both i and iv c. both ili and iv d. both i and il The return type of the input() function is a. string b. integer c. list d. tuple Which of the following operator cannot be used with string data type? at b. in ot d/ 10 Given an object obj1 = (10, 15, 25, 30). Identify the statement that will result in an error. a, print(obj1[2]) b, obj1[2] = 20 ¢. print(min(obj1)) d. print(len(obj1)) 1 Which of the following statements is incorrect in the context of binary files? a. Information is stored in the same format in which the information is held in memory. b, No end of line (EOL) character translation takes place. c. Every line ends with a new line character. d. pickle module is used for reading and writing. 2 What is the significance of the tell() method? a. tells the path of the file. b, tells the current position of the file pointer within the file. c. tells the end position within the file d. checks the existence of a file at the desired location3 Which of the following statements is true? a. pickling creates an object from a sequence of bytes. b. pickling is used for object serialization. c. pickling is used for object deserialization d, pickling is used to manage all types of files in Python, 14 Syntax of seek function in Python is myfile seek(offset, reference_point) where myfile is the file object. What is the default value of reference_point? ao b.1 2 4.3 15 Which of the following components are part of a function header in Python? i. function name ii. return statement il, parameter list iv. def keyword a. only i b. iand ii c. ii and iv d.i,ili and iv 16 Which of the following function headers is correct? a, def cal_si(p=100, r, t=2): b. def cal_si(p=100, r=8, t): c. def cal_si(p, r=8, t) d. def cal_si(p, r=8, t=2) 17 Which of the following is the correct way to call a function? a. my_fune() b, def my_func() c. return my_func d. call my_func() 18 Which of the following characters act as default delimiter in a CSV file? a, (colon) : b. (hyphen) - c. (comma) , d. (vertical line) | 19 Given below is one way of opening a file Student csv fle in write mode. myfile = open("Student.csv","w",newline="") What is the importance of n: a. Anew line gets added to the file. b. Empty string gets appended to the first line. c. Empty string gets appended to all lines. d, EOL character translation is suppressed ines"?20 Consider the following python program = open ("Student csv", Mem) x (fh) ureader = csv. re: for rec in stureader print (rec) What will be the data type of rec? a. string b. list c. tuple d. dictionary 21 __ | Which of the following is not a function/method of the csv module in Python? a, read() b, reader() c. writer() d. writerow() 22 | Which one of the following is the default extension of a Python file? a. exe b. ptt ©. .py dp 23 | Which of the following symbol is used in Python for comments? as b@ ell dt 24 | Which of the following statements opens a binary file "record. bin" in write mode and writes an object 1st1 = [1,2,3,4] on the binary file? a. with open(‘record.bin’,'wb') as myfile: pickle.dump(|st1 ,myfile) b. with open('record.bin',‘wb') as myfile: pickle.dump(myfile,|st1) c. with open(‘record. bin’ wb") as myfile: pickle.dump(myfile,|st1) d. with open(‘record.bin' 'ab’) as myfile: pickle.dump(myfile,|st1) 25 | Which of the following statements is false in the context of dictionary? a) The values of a dictionary can be accessed using keys b) The keys of a dictionary can be accessed using values. c) Elements in a dictionary are in form of key-value pairs. d) Dictionaries are mutable.Section-B This section consists of 24 Questions (26 to 49). Attempt any 20 questions. 26 | Whatis the output of the following code? T=(100) print (T*2) a. Syntax error (200,) c. 200 d, (100,100) 27 _ | Suppose the content of i Twinkle twinkle litle star How | wonder what you are Up above the world so high Like a diamond in the sky What will be the output of the following code? myfile = open ("My txt") data = my: .readlines() ei len (data)) yfile.close() a3 b.4 c. 106 d. 22 28 | Identify the output of the following Python statements. x= 0.0, 0, 12.0],[13.0, 14.0, 15.0]] y = x(1) (2 print (y) a. 11.0 b. 12.0 ©. 14.0 d, 15.0 29 | Identify the output of the following Python statements. x=2 while x <9: print (x, end="') x-xe1 a. 12345678 b, 3456789 ©. 2345678 d, 2345678930 Identify the output of the following Python statements, bel for a in range(1, 10, 2): bteat2 print (b) a.31 b, 33 ©. 36 d, 39 31 Tdentify the output of the following Python statements istl {10, 15, 20, 25, 30] insert( 3, 4) l.insert( 2, 3) (ist1{-5]) 32 Raghav is trying to write an object objt = (1,2,3,4,5) on a binary file Consider the following code written by him. import pickle objl = (1,2,3,4,5) myfile = open( bin", 'wb') pickle. men myfile.close() Identify the missing code in Statement 1. a, dump(myfile,obj1) b. dump(obj1, myfile) c. write(obj1 myfile) d. load(myfile,obj1) 33 The content of a binary file "employee . dat" is shown below where the Header is not a part of file content (i.e only Row1 to RowS are present in the file) Header—e[_Empno | Empname | Salary Rowl —e[ 101 Anuj | 50000 Row2 —»{ 102 ‘Arijita__ | 40000 Rows —>|__ 103, Hanika | 30000 Rowt —>{ 104 Firoz | 60000 Rows —>{ 105 | Vijaylakshmi | 40000#Linel totSum=totsum+R[2] ose() print (totSum) When the above-mentioned function, display (103) is executed, the output displayed is 190000, Which of the following statement should be used in the blank space of the line marked as Line’ to obtain the above output? a. jump b. break c. continue d._return 34 | What will be the output of the following Python code? def add (num, num2): sum = numl + num2 dd (20, 30) nt (sum) a, 50 b.0 c. Null d, None 35 | Evaluate the following expression and identify the correct answer 16 -(4+2)*5 +243 "4 a. 54 b. 46 o.18 d, 32 36 | What will be the output of the following code? def my_func(varl=100, var2=200): varl+=10 var2 = var2 - 10 xeturn varlt+var2 print (my_func(50),my_func()) a. 100 200 b. 150 300 ©. 250 75 d. 250 30037 What will be the output of the following code? value = 50 def display (N): global value value = 25 if N87==0 value = value + N else: value print (value, end display (20) print (value) 50#50 50#5 50#30 5H#50H# lao op 38 Which of the following options can be the output for the following code? import random =["Delhi", "Mumbai", y in range (4 print (List [x],end=' a, DelhitMumbaiffChennaiffKolkatatt b, Mumbai##Chennai#fKolkata#Mumbaitt c. Mumbai# Mumbai #Mumbai # Delhii# d, Mumbai# Mumbai #Chennai # Mumbai nnai", "Kolkata" 39 What is the output of the following code snippet? (M,N) = def ChangeVa. L = (25,8, 75,12] hangeVal (L, 4) for i in L: print (i,end="#") a) SH#BHISHAH b) SH#BHSHAH 0) S#BH#15#14# d) SH1e#15#4H 40 ‘Suppose the content of "Myfile.txt"is Humpty Dumpty sat on a wall Humpty Dumpty had a great fall All the king's horses and all the king's men Couldn't put Humpty together againWhat will be the output of the following code? en ("Myfile.txt") ead().split () a. 24 b. 25 ©. 26 d. 27 ‘41 | Find the output of the following code: Name="PythoN3@1" for x in range(len(Name)): if Name(x].isupper() R=R+Name [x] . lower () elif Name (x de +Name [x] .upper () elif Name(x].isdigit (): lame (x-1] print (R) a. pYTHOn##@ b. pYTHOnN#@ c. pYTHOn#@ d. pYTHOnN@# 42 | Suppose the content of "Myfile. txt" is Honesty is the best policy. What will be the output of the following code? myfile = open("Myfile.txt") x myfile.read() print (len (x)) myfile.close() as b. 25 ©. 26 4.27 43 Suppose the content of "Myfile.txt" is Humpty DUMPTY sat on a wall Humpty DUMPTY had a great fall All the king's horses and all the king's men Couldn't put Humpty together againWhat will be the output of the following code? myfile = open("Myfile.txt") x = myfile.read() .lower() y = x.count (‘umpty') print (y) myfile.close() oom RON d 44 What will be the output of the following code? def myfunc(): global x xt print (x, print (x, end=" myfune () print (x, end=' ') a333 b.353 6.335 4.355 45 ‘Suppose the content of "Myfile. txt" is Ek Bharat Shreshtha Bharat What will be the output of the following code? myfile = open("Myfile.txt") = list (YaeiouAgI0U") myfile.read() y in x: if(y in print (ve) nyfile.close () st): aes Cena46 Suppose the content of "yfile is Twinkle twinkle little star How | wonder what you are Up above the world so high Like a diamond in the sky Twinkle twinkle little star What will be the output of the following code? myfile = open("Myfile line_count = 0 print (line_c myfile.close() aece aon 47 Consider the following directory structure, (5 Csaea o=== O Gene OCS rte Suppose root directory (School:\) and present working directory are the same, What will be the absolute path of the file Syllabus jpg? a, School/Syllabus.jpg b. School/Academics/Syllabus jpg c. School/Academics/../Syllabus jpg d, School/Examination/Syllabus.jpg48 ‘Assume the content of the text file "Myfile.txt" is: ‘Arjun Kumar. Ismail Khan Joseph B Hanika Kiran What will be the data type of data_rec? myfile = open("Myfile.txt") data_rec = myfile.readlines() myfile.close() a. string b. list c. tuple d. dictionary 49 What will be the output of the following code? tupl = (1,2, [1,21,3) (1,2,1,3.14],3) ©. (1,2,(1,2],3.14) d. Error Message Section-C Case Study based Questions This section consists of 6 Questions (50 -55) Attempt any 5 questions. Rohit, a student of class 12, is learning csv module in Python. During the examination, he has been given a stub Python program (shown below) to create a CSV File udent . csv" (content shown below). Help him in completing the code which creates the desired CSV File. CSV File 1,AKSHAY.XILA, 2,ABHISHEK, XIl,A, 3,ARVIND,XII,A 4,RAVIXILA 5,ASHISH,XILA Incomplete Code import #Statement-1 th= opent , newline=") #Statement-2 stuwriter = osv ‘#Statement-3 data =[] header = ['ROLL_NO’, ‘NAME’, ‘CLASS’, 'SECTION]dala appena{header) for in range(s): roll_no = int(input(‘Enter Roll Number :*)) put("Enter Name :") input("Enter Class :") section = input("Enter Section :") 1 #Statement-4 data.append( #Statoment-5 stuwriter. (data) #Statement-6 fth.close() 50 Identify the suitable code for blank space in the line marked as Statement-1. a) csv file b) csv c) csv d) csv module 51 Identify the missing code for blank space in the line marked as Statement-2. a) "Student.csv’, "wo" b) "Student.csv’,"w" ©) "Student esv","r" d) "Student.csv","rb" 52 Choose the function name (with argument) that should be used in the line marked as Statement-3. a) reader(n) b) reader(MyFile) c) writer(th) d) writer(MyFile) 53 Identify the suitable code for the blank space in Statement-4 a) ROLL_NO’, ‘NAME’, ‘CLASS’, ‘SECTION’ b) ROLL_NO, NAME, CLASS, SECTION ¢) 'roll_no’, ‘name’, ‘Class, ‘section’ d) roll_no, name, Class, section 34 Identify the suitable code for blank space in Statement-5. a) data b) record ©) rec d) insert 55 Choose the function name that should be used in the blank space of the line marked as Statement-6 to create the desired CSV File? a) dump() b) load() c) writerows() d) writerow()
You might also like
ComputerScience-SQP TERM1
PDF
No ratings yet
ComputerScience-SQP TERM1
14 pages
ComputerScience SQP
PDF
No ratings yet
ComputerScience SQP
13 pages
Xii CS Sample Paper-2 PDF
PDF
No ratings yet
Xii CS Sample Paper-2 PDF
12 pages
Computer Science Set 3 HSSC Term I
PDF
No ratings yet
Computer Science Set 3 HSSC Term I
10 pages
12 CS Pa2 06102021 1
PDF
No ratings yet
12 CS Pa2 06102021 1
12 pages
Qna For Cs (AutoRecovered)
PDF
No ratings yet
Qna For Cs (AutoRecovered)
23 pages
Ssmple QP XII
PDF
No ratings yet
Ssmple QP XII
12 pages
Cs Xii (2021 22) Term I (QP) Set A
PDF
No ratings yet
Cs Xii (2021 22) Term I (QP) Set A
11 pages
Sample Questions Set
PDF
No ratings yet
Sample Questions Set
31 pages
12 Cs Final Mock Objective Type July 2021
PDF
No ratings yet
12 Cs Final Mock Objective Type July 2021
10 pages
Virendra Public School12 Term1 Comp
PDF
No ratings yet
Virendra Public School12 Term1 Comp
11 pages
PA 2 Computer Science 12 Set A
PDF
No ratings yet
PA 2 Computer Science 12 Set A
9 pages
Computer Science-Class-Xii-Sample Question Paper-1
PDF
No ratings yet
Computer Science-Class-Xii-Sample Question Paper-1
12 pages
Computer Science Term 1 Class 12
PDF
No ratings yet
Computer Science Term 1 Class 12
13 pages
Term I - Class Xii - Computer Science
PDF
No ratings yet
Term I - Class Xii - Computer Science
8 pages
Sample Question Paper (Term-I) : General Instructions
PDF
No ratings yet
Sample Question Paper (Term-I) : General Instructions
7 pages
MCQ Test
PDF
No ratings yet
MCQ Test
13 pages
Cs One Mark QP Set 001
PDF
No ratings yet
Cs One Mark QP Set 001
17 pages
GRADE 12 PREBOARD-1 (Term-1) Computer Science
PDF
No ratings yet
GRADE 12 PREBOARD-1 (Term-1) Computer Science
9 pages
North Cluster Examination 2021-2022 Class: Xii Subject: Computer Science
PDF
No ratings yet
North Cluster Examination 2021-2022 Class: Xii Subject: Computer Science
9 pages
Computer Science QP
PDF
No ratings yet
Computer Science QP
16 pages
Board Model Test1
PDF
No ratings yet
Board Model Test1
8 pages
50% CS Answer Key 02.08.24
PDF
No ratings yet
50% CS Answer Key 02.08.24
6 pages
Day2 QP
PDF
No ratings yet
Day2 QP
14 pages
Cbsepython - In-Term 1 Practice Questions Class 12 Computer Science 083
PDF
100% (1)
Cbsepython - In-Term 1 Practice Questions Class 12 Computer Science 083
21 pages
Python MCQ Questions and Answers 2021-22 Sample Paper 2
PDF
100% (1)
Python MCQ Questions and Answers 2021-22 Sample Paper 2
1 page
Set 1 SQP
PDF
No ratings yet
Set 1 SQP
8 pages
CS QP - Class Xi Annual Exam April 30TH
PDF
No ratings yet
CS QP - Class Xi Annual Exam April 30TH
5 pages
Jaipuriar School
PDF
No ratings yet
Jaipuriar School
11 pages
Kendriya Vidyalaya Sangathan Jaipur Region: Sample Question Paper (Term-I)
PDF
0% (1)
Kendriya Vidyalaya Sangathan Jaipur Region: Sample Question Paper (Term-I)
8 pages
12 CS Preterm Answerkeys
PDF
No ratings yet
12 CS Preterm Answerkeys
8 pages
Kendriya Vidyalaya J7 Sangathan Jaipur Region: Sample Question Paper (Term-I)
PDF
No ratings yet
Kendriya Vidyalaya J7 Sangathan Jaipur Region: Sample Question Paper (Term-I)
7 pages
XII-CS Holiday Homework - Autumn Break
PDF
No ratings yet
XII-CS Holiday Homework - Autumn Break
9 pages
REV 5 - Q WITH ANS - Text, CSV and Binary Files 13.09.24
PDF
No ratings yet
REV 5 - Q WITH ANS - Text, CSV and Binary Files 13.09.24
6 pages
CS Practice Paper Term1
PDF
No ratings yet
CS Practice Paper Term1
19 pages
CS QP
PDF
No ratings yet
CS QP
10 pages
12 CS PT 0402 Ans
PDF
No ratings yet
12 CS PT 0402 Ans
8 pages
Computer Science-Class-Xii-Sample Question Paper-2
PDF
No ratings yet
Computer Science-Class-Xii-Sample Question Paper-2
11 pages
2024 08 06 10 01 Solution
PDF
No ratings yet
2024 08 06 10 01 Solution
10 pages
Computer Science Class 12 Sample Question
PDF
No ratings yet
Computer Science Class 12 Sample Question
12 pages
Computer Science Class 12 Sample Question Paper - 1
PDF
No ratings yet
Computer Science Class 12 Sample Question Paper - 1
12 pages
Chennai Set2
PDF
No ratings yet
Chennai Set2
9 pages
File WK
PDF
No ratings yet
File WK
7 pages
XII - CSC Final Paper 2nd 33% Module
PDF
No ratings yet
XII - CSC Final Paper 2nd 33% Module
4 pages
Practice Test - QP
PDF
No ratings yet
Practice Test - QP
9 pages
Workshhet MCQ 2
PDF
No ratings yet
Workshhet MCQ 2
4 pages
XII CS Term1 Preboard Combined 2021payal
PDF
0% (1)
XII CS Term1 Preboard Combined 2021payal
252 pages
Kendriya Vidyalaya Sangathan Jaipur Region: Sample Question Paper (Term-I)
PDF
No ratings yet
Kendriya Vidyalaya Sangathan Jaipur Region: Sample Question Paper (Term-I)
7 pages
Class Xii Centum Phase-1 Computer Sceince 23-10-2024
PDF
No ratings yet
Class Xii Centum Phase-1 Computer Sceince 23-10-2024
7 pages
Kendriya Vidyalaya Sangathan Jaipur Region: Sample Question Paper (Term-I)
PDF
No ratings yet
Kendriya Vidyalaya Sangathan Jaipur Region: Sample Question Paper (Term-I)
7 pages
CS Xii
PDF
No ratings yet
CS Xii
6 pages
File Handling
PDF
No ratings yet
File Handling
8 pages
PT-1 Assignment (CS) AK
PDF
No ratings yet
PT-1 Assignment (CS) AK
9 pages
Revision 2 QP
PDF
No ratings yet
Revision 2 QP
6 pages
Unit Test - 1 Feb 26
PDF
No ratings yet
Unit Test - 1 Feb 26
5 pages
Class12 CS Quarterly QP
PDF
No ratings yet
Class12 CS Quarterly QP
7 pages
Fileobject - Readlines (Sizehint) Fileobject - Readlines Fileobject - Readlines (Sequence) None of The Mentioned Writecharacters Write
PDF
No ratings yet
Fileobject - Readlines (Sizehint) Fileobject - Readlines Fileobject - Readlines (Sequence) None of The Mentioned Writecharacters Write
4 pages
KVS Chandigarh Region Paper
PDF
No ratings yet
KVS Chandigarh Region Paper
9 pages
XII Comp SC
PDF
No ratings yet
XII Comp SC
5 pages