Read and download PDF of CBSE Class 12 Computer Science Sample Paper 2023 Set A designed as per the latest curriculum and examination pattern for Class 12 issued by CBSE, NCERT and KVS. The latest Class 12 Computer Science Sample Papers have been provided with solutions so that the students can solve these practice papers and then compare their answers. This will help them to identify mistakes and improvement areas in Computer Science Class 12 which they need to study more to get better marks in Class 12 exams. After solving these guess papers also refer to solved Class 12 Computer Science Question Papers available on our website to build strong understanding of the subject
Sample Paper for Class 12 Computer Science Pdf
Students can refer to the below Class 12 Computer Science Sample Paper designed to help students understand the pattern of questions that will be asked in Class 12 exams. Please download CBSE Class 12 Computer Science Sample Paper 2023 Set A
Computer Science Class 12 Sample Paper
SECTION A
1. State True or False
“Variable declaration is implicit in Python.”
Answer: TRUE
2. Which of the following is an invalid datatype in Python?
(a) Set
(b) None
(c) Integer
(d) Real
Answer: D
3. Given the following dictionaries
dict_exam={"Exam":"AISSCE", "Year":2023}
dict_result={"Total":500, "Pass_Marks":165}
Which statement will merge the contents of both dictionaries?
(a) dict_exam.update(dict_result)
(b) dict_exam + dict_result
(c) dict_exam.add(dict_result)
(d) dict_exam.merge(dict_result)
Answer: A
4. Consider the given expression:
not True and False or True
Which of the following will be correct output if the given expression is evaluated?
(a) True
(b) False
(c) NONE
(d) NULL
Answer: A
5. Select the correct output of the code:
a = "Year 2022 at All the best"
a = a.split('2')
b = a[0] + ". " + a[1] + ". " + a[3]
print (b)
(a) Year . 0. at All the best
(b) Year 0. at All the best
(c) Year . 022. at All the best
(d) Year . 0. at all the best
Answer: A
6. Which of the following mode in file opening statement results or generates an error if the file does not exist?
(a) a+
(b) r+
(c) w+
(d) None of the above
Answer: B
7. Fill in the blank:
______ command is used to remove primary key from the table in SQL.
(a) update
(b) remove
(c) alter
(d) drop
Answer: C
8. Which of the following commands will delete the table from MYSQL database?
(a) DELETE TABLE
(b) DROP TABLE
(c) REMOVE TABLE
(d) ALTER TABLE
Answer: B
9. Which of the following statement(s) would give an error after executing the following code?
S="Welcome to class XII" # Statement 1
print(S) # Statement 2
S="Thank you" # Statement 3
S[0]= '@' # Statement 4
S=S+"Thank you" # Statement 5
(a) Statement 3
(b) Statement 4
(c) Statement 5
(d) Statement 4 and 5
Answer: B
10. Fill in the blank:
_________ is a non-key attribute, whose values are derived from the primary key of some other table.
(a) Primary Key
(b) Foreign Key
(c) Candidate Key
(d) Alternate Key
Answer: B
11. The correct syntax of seek() is:
(a) file_object.seek(offset [, reference_point])
(b) seek(offset [, reference_point])
(c) seek(offset, file_object)
(d) seek.file_object(offset)
Answer: A
12. Fill in the blank:
The SELECT statement when combined with __________ clause, returns records without repetition.
(a) DESCRIBE
(b) UNIQUE
(c) DISTINCT
(d) NULL
Answer: C
13. Fill in the blank:
______is a communication methodology designed to deliver both voice and multimedia communications over Internet protocol.
(a) VoIP
(b) SMTP
(c) PPP
(d) HTTP
Answer: A
14. What will the following expression be evaluated to in Python?
print(15.0 / 4 + (8 + 3.0))
(a) 14.75
(b) 14.0
(c) 15
(d) 15.5
Answer: A
15. Which function is used to display the total number of records from table in a database?
(a) sum(*)
(b) total(*)
(c) count(*)
(d) return(*)
Answer: C
16. To establish a connection between Python and SQL database, connect() is used. Which of the following arguments may not necessarily be given while calling connect() ?
(a) host
(b) database
(c) user
(d) password
Answer: B
Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as
(a) Both A and R are true and R is the correct explanation for A
(b) Both A and R are true and R is not the correct explanation for A
(c) A is True but R is False
(d) A is false but R is True
17. Assertion (A):- If the arguments in function call statement match the number and order of arguments as defined in the function definition, such arguments are called positional arguments.
Reasoning (R):- During a function call, the argument list first contains default argument(s) followed by positional argument(s).
Answer: C
18. Assertion (A): CSV (Comma Separated Values) is a file format for data storage which looks like a text file.
Reason (R): The information is organized with one record on each line and each field is separated by comma.
Answer: A
SECTION B
19. Rao has written a code to input a number and check whether it is prime or not. His code is having errors. Rewrite the correct code and underline the corrections made.
def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else:
print("Number is prime \n’)
Answer: def prime():
n=int(input("Enter number to check :: ")) #bracket missing
for i in range (2, n//2):
if n%i==0: # = missing
print("Number is not prime \n")
break #wrong indent
else:
print("Number is prime \n”) # quote mismatch
20. Write two points of difference between Circuit Switching and Packet Switching.
Answer:
Circuit Switching | Packet Switching |
Circuit switching is the method of switching which is used for establishing a dedicated communication path between the sender and the receiver. | Packet switching is the method of switching where no dedicated path is established from the source to the destination. |
Data is processed and transmitted at the source only. | Data is processed and transmitted, not only at the source but at each switching station. |
It is more reliable. | It is less reliable. |
OR
Write two points of difference between XML and HTML.
Answer: XML (Extensible MarkupLangauge)
♦ XML tags are not predefined, they are user defined
♦ XML stores and transfers data.
♦ Dynamic in nature
HTML (Hypertext Markup Langauge)
♦ HTML tags are pre-defined and it is a markup language
♦ HTML is about displaying data.
♦ Static in nature
21. (a) Given is a Python string declaration:
myexam="@@CBSE Examination 2022@@"
Write the output of: print(myexam[::-2])
(b) Write the output of the code given below:
my_dict = {"name": "Aman", "age": 26}
my_dict['age'] = 27
my_dict['address'] = "Delhi"
print(my_dict.items())
Answer: (a) @20 otnmx SC@
(b) dict_items([('name', 'Aman'), ('age', 27), ('address', 'Delhi')])
22. Explain the use of ‘Foreign Key’ in a Relational Database Management System. Give example to support your answer.
Answer: A foreign key is used to set or represent a relationship between two relations (or tables) in a database. Its value is derived from the primary key attribute of another relation.
For example:
In the tables TRAINER and COURSE given below, TID is primary key in TRAINER
table but foreign key in COURSE table.
TRAINER
23.
(a) Write the full forms of the following:
(i) SMTP (ii) PPP
(b) What is the use of TELNET?
Answer: (a) (i) SMTP: Simple Mail Transfer Protocol
(ii) PPP: Point to Point Protocol
(b) TELNET is used to access a remote computer / network.
24. Predict the output of the Python code given below:
def Diff(N1,N2):
if N1>N2:
return N1-N2
else:
return N2-N1
NUM= [10,23,14,54,32]
for CNT in range (4,0,-1):
A=NUM[CNT]
B=NUM[CNT-1]
print(Diff(A,B),'#', end=' ')
Answer: 22 # 40 # 9 # 13 #
OR
Predict the output of the Python code given below:
tuple1 = (11, 22, 33, 44, 55 ,66)
list1 =list(tuple1)
new_list = []
for i in list1:
if i%2==0:
new_list.append(i)
new_tuple = tuple(new_list)
print(new_tuple)
Answer: (22,44,66)
25. Differentiate between count() and count(*) functions in SQL with appropriate example.
Answer: COUNT(*) returns the count of all rows in the table, whereas COUNT () is used with Column_Name passed as argument and counts the number of non-NULL values in a column that is given as argument. Example: Table : EMPL
OR
Categorize the following commands as DDL or DML:
INSERT, UPDATE, ALTER, DROP
Answer: DDL- ALTER, DROP
DML – INSERT, UPDATE
SECTION C
26. (a) Consider the following tables – Bank_Account and Branch:
Table: Bank_Account
What will be the output of the following statement?
SELECT * FROM Bank_Account NATURAL JOIN Branch;
(b) Write the output of the queries (i) to (iv) based on the table,
TECH_COURSE given below:
(i) SELECT DISTINCT TID FROM TECH_COURSE;
(ii) SELECT TID, COUNT(*), MIN(FEES) FROM
TECH_COURSE GROUP BY TID HAVING COUNT(TID)>1;
(iii) SELECT CNAME FROM TECH_COURSE WHERE
FEES>15000 ORDER BY CNAME;
(iv) SELECT AVG(FEES) FROM TECH_COURSE WHERE
FEES BETWEEN 15000 AND 17000;
Answer: (a)
(b) (i) DISTINCT TID
101
NULL
102
104
103
(ii) TID COUNT(*) MIN(FEES)
101 2 12000
(iii) CNAME
Digital marketing
Mobile Application Development
(iv) 15500.00
27. Write a method COUNTLINES() in Python to read lines from text file ‘TESTFILE.TXT’ and display the lines which are not starting with any vowel.
Example:
If the file content is as follows:
An apple a day keeps the doctor away.
We all pray for everyone’s safety.
A marked difference will come in our country.
The COUNTLINES() function should display the output as:
The number of lines not starting with any vowel - 1
Answer: def COUNTLINES() :
file = open ('TESTFILE.TXT', 'r')
lines = file.readlines()
count=0
for w in lines :
if (w[0]).lower() not in 'aeoiu'
count = count + 1
print ("The number of lines not starting with any
vowel: ", count)
file.close()
COUNTLINES()
OR
Write a function ETCount() in Python, which should read each character of a text file “TESTFILE.TXT” and then count and display the count of occurrence of alphabets E and T individually (including small cases e and t too).
Example:
If the file content is as follows:
Today is a pleasant day.
It might rain today.
It is mentioned on weather sites
The ETCount() function should display the output as:
E or e: 6
T or t : 9
Answer: def ETCount() :
file = open ('TESTFILE.TXT', 'r')
lines = file.readlines()
countE=0
countT=0
for w in lines :
for ch in w:
if ch in 'Ee':
countE = countE + 1
if ch in 'Tt':
countT=countT + 1
print ("The number of E or e : ", countE)
print ("The number of T or t : ", countT)
file.close()
28. (a) Write the outputs of the SQL queries (i) to (iv) based on the relations Teacher and Placement given below:
Table : Teacher
(i) SELECT Department, avg(salary) FROM Teacher
GROUP BY Department;
(ii) SELECT MAX(Date_of_Join),MIN(Date_of_Join) FROM
Teacher;
(iii) SELECT Name, Salary, T.Department, Place FROM
Teacher T, Placement P WHERE T.Department =
P.Department AND Salary>20000;
(iv) SELECT Name, Place FROM Teacher T, Placement P
WHERE Gender =’F’ AND T.Department=P.Department;
(b) Write the command to view all tables in a database.
Answer: (a)
(i) Department Avg(Salary)
Computer Sc 16500.00
History 30000.00
Mathematics 25000.00
(ii) Max(Date_of_Join) Min(Date_of_Join)
2021-09-05 2017-03-04
(iii) Name Salary Department Place
Randeep 30000 Mathematics Jaipur
Samira 40000 History Ahmedabad
Raman 25000 Mathematics Jaipur
Shyam 30000 History Ahmedabad
Shiv 21000 Computer Sc Nagpur
(iv) Name Place
Samira Ahmedabad
Suman Ahmedabad
Shalaka Jaipur
(b) SHOW TABLES;
Please click the link below to download CBSE Class 12 Computer Science Sample Paper 2023 Set A
CBSE Class 12 Computer Science Sample Paper 2023 Set A |
CBSE Class 12 Computer Science Sample Paper 2023 Solved |
CBSE Class 12 Computer Science Boards 2021 Sample Paper Solved |
CBSE Class 12 Computer Science Sample Paper 2021 Set A |
CBSE Class 12 Computer Science Sample Paper 2021 Set C Solved |
CBSE Class 12 Computer Science Sample Paper 2023 Set A
We hope you liked the above provided CBSE Class 12 Computer Science Sample Paper 2023 Set A. To get an understanding of the type of questions which were asked in exams, it is important for Class 12 students to understand the way sample Paper are set by teachers. Students can download the Sample Paper for Class 12 Computer Science which will be coming in the exams so that you can practise them and solve all types of questions that can be asked in exams. By doing CBSE Class 12 Computer Science Sample Paper 2023 Set A you will understand the regular questions and MCQ questions for Class 12 Computer Science which are always asked. You can download CBSE Class 12 Computer Science Sample Paper and Class 12 Computer Science Question Papers in PDF. You should attempt all the last year question paper for Class 12 and Class 12 Computer Science MCQ Test in examination conditions at home and then compare their answers with the solutions provided by our teachers.
You can download CBSE Class 12 Computer Science Sample Paper 2023 Set A from StudiesToday.com
Regular practice of sample question paper given on studiestoday for CBSE Class 12 Computer Science Sample Paper 2023 Set A can help you to score better marks in exams
Yes, studiestoday.com provides all latest CBSE Class 12 Computer Science Sample Papers with answers based on the latest format issued for current academic session
Yes, mock CBSE Class 12 Computer Science Sample Paper 2023 Set A are available in multiple languages, including English, Hindi