CBSE Sample Papers Class 12 Computer Science 2023

We advise students to check Class 12 Computer Science model question papers 2022-23 on the myCBSEguide app. The question paper format has some changes that every student must know. CBSE Sample Papers Class 12 Computer Science 2023 will have mostly subjective questions. There are 16 MCQs and 2 ARQs only. All other questions are in descriptive format. So, you have to give yourself proper time to study computer science this year.

Sample Papers of Computer Science class 12 – free PDF Download

CBSE Sample Papers Class 12 Computer Science 2023 The new marking scheme and blueprint for class 12 have been released by CBSE. We are providing Computer Science sample papers for class 12 CBSE board exams. Sample Papers are available for free download in myCBSEguide app and website in PDF format. CBSE Sample Papers Class 12 Computer Science With Solutions of 10+2 Computer Science are made available by CBSE board exams are over. CBSE marking scheme and blue print is provided along with the Sample Papers. This helps students find answer the most frequently asked question, How to prepare for CBSE board exams. CBSE Sample Papers of class 12 Computer Science for 2018 Download the app today to get the latest and up-to-date study material. CBSE sample paper for class 12 Computer Science with questions and answers (solution).

Sample Papers for Class 12 Computer Science 2023 

Download as PDF

Sample paper 2023 class 12 Computer Science

myCBSEguide provides CBSE class 12 Board Sample Papers of Computer Science for the years 2022 and 2023 with solutions in PDF format for free download. The CBSE Sample Papers for all – NCERT books and based on CBSE’s latest syllabus must be downloaded and practiced by students. Class 12 Computer Science New Sample Papers follow the blueprint of that year only. Student must check the latest syllabus and marking scheme. Sample papers for class 12 Computer Science and other subjects are available for download as PDF in the app too. myCBSEguide provides sample papers with solutions for the years 2022, 2023, 2024.

CBSE Sample Papers Class 12 Computer Science 2023

CBSE Class 12
Computer Science (Code No. 083)
(Sample Paper 2022-23)


Maximum Marks: 70
Time Allowed: 3 hours

General Instructions:

  1. This question paper contains five sections, Section A to E.
  2. All questions are compulsory.
  3. Section A have 18 questions carrying 01 mark each.
  4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
  5. Section C has 05 Short Answer type questions carrying 03 marks each.
  6. Section D has 03 Long Answer type questions carrying 05 marks each.
  7. Section E has 02 questions carrying 04 marks each. One internal choice is given in Q35 against part c only.
  8. All programming questions are to be answered using Python Language only.

CBSE class 12 Computer Science Sample Paper SECTION A

  1. State True or False
    “Variable declaration is implicit in Python.”
  2. Which of the following is an invalid datatype in Python?
    1. Set
    2. None
    3. Integer
    4. Real
  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?

    1. dict_exam.update(dict_result)
    2. dict_exam + dict_result
    3. dict_exam.add(dict_result)
    4. dict_exam.merge(dict_result)
  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?

    1. True
    2. False
    3. NONE
    4. NULL
  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)

    1. Year . 0. at All the best
    2. Year 0. at All the best
    3. Year . 022. at All the best
    4. Year . 0. at all the best
  6. Which of the following mode in file opening statement results or generates an error if the file does not exist?
    1. a+
    2. r+
    3. w+
    4. None of the above
  7. Fill in the blank:
    ________ command is used to remove primary key from the table in SQL.

    1. update
    2. remove
    3. alter
    4. drop
  8. Which of the following commands will delete the table from MYSQL database?
    1. DELETE TABLE
    2. DROP TABLE
    3. REMOVE TABLE
    4. ALTER TABLE
  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

    1. Statement 3
    2. Statement 4
    3. Statement 5
    4. Statement 4 and 5
  10. Fill in the blank:
    ________ is a non-key attribute, whose values are derived from the primary key of some other table.

    1. Primary Key
    2. Foreign Key
    3. Candidate Key
    4. Alternate Key
  11. The correct syntax of seek() is:
    1. file_object.seek(offset [, reference_point])
    2. seek (offset [, reference_point])
    3. seek (offset, file_object)
    4. seek.file_object (offset)
  12. Fill in the blank:
    The SELECT statement when combined with ________ clause, returns records without repetition.

    1. DESCRIBE
    2. UNIQUE
    3. DISTINCT
    4. NULL
  13. Fill in the blank:
    ________ is a communication methodology designed to deliver both voice and multimedia communications over Internet protocol.

    1. VoIP
    2. SMTP
    3. PPP
    4. HTTP
  14. What will the following expression be evaluated to in Python?
    print (15.0/4 + (8 + 3.0))

    1. 14.75
    2. 14.0
    3. 15
    4. 15.5
  15. Which function is used to display the total number of records from table in a database?
    1. sum (*)
    2. total (*)
    3. count (*)
    4. return (*)
  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 ()?
    1. host
    2. database
    3. user
    4. password

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

  1. 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).
  2. 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.

CBSE class 12 Computer Science Sample Paper SECTION B

  1. 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’)
  2. Write two points of difference between Circuit Switching and Packet Switching.

    OR

    Write two points of difference between XML and HTML.

    1. Given is a Python string declaration:
      myexam=”@@CBSE Examination [email protected]@”
      Write the output of: print (myexam[ : : -2])
    2. 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())
  3. Explain the use of ‘Foreign Key’ in a Relational Database Management System. Give example to support your answer.
    1. Write the full forms of the following:
      1. SMTP
      2. PPP
    2. What is the use of TELNET?
  4. 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 = ‘ ‘)

    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)

  5. Differentiate between count() and count(*) functions in SQL with appropriate example.

    OR

    Categorize the following commands as DDL or DML:
    INSERT, UPDATE, ALTER, DROP

CBSE class 12 Computer Science Sample Paper SECTION C

    1. Consider the following tables – Bank_Account and Branch:
      Table: Bank_Account

      ACodeNameType
      A01AmritaSavings
      A02ParthodasCurrent
      A03MirabenCurrent

      Table: Branch

      ACodeCity
      A01Delhi
      A02Mumbai
      A01Nagpur

      What will be the output of the following statement?
      SELECT * FROM Bank_Account NATURAL JOIN Branch;

    2. Write the output of the queries (i) to (iv) based on the table, TECH_COURSE given below:
      Table: TECH_COURSE
      CIDCNAMEFEESSTARTDATETID
      C201Animation and VFX120002022-07-02101
      C202CADD150002021-11-15NULL
      C203DCA100002020-10-01102
      C204DDTP90002021-09-15104
      C205Mobile Application Development180002022-11-01101
      C206Digital marketing160002022-07-25103
      1. SELECT DISTINCT TID FROM TECH_COURSE;
      2. SELECT TID, COUNT (*), MIN(FEES) FROM TECH_COURSE GROUP BY TID HAVING COUNT(TID) >1;
      3. SELECT CNAME FROM TECH_COURSE WHERE FEES>15000 ORDER BY CNAME;
      4. SELECT AVG(FEES) FROM TECH_COURSE WHERE FEES BETWEEN 15000 AND 17000;
  1. 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

    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

    1. Write the outputs of the SQL queries (i) to (iv) based on the relations Teacher and Placement given below:
      Table : Teacher

      T_IDNameAgeDepartmentDate_of_joinSalaryGender
      1Arunan34Computer Sc2019-01-1012000M
      2Saman31History2017-03-2420000F
      3Randeep32Mathematics2020-12-1230000M
      4Samira35History2018-07-0140000F
      5Raman42Mathematics2021-09-0525000M
      6Shyam50History2019-06-2730000M
      7Shiv44Computer Sc2019-02-2521000M
      8Shalakha33Mathematics2018-07-3120000F

      Table: Placement

      P_IDDepartmentPlace
      1HistoryAhmedabad
      2MathematicsJaipur
      3Computer ScNagpur
      1. SELECT Department, avg(salary) FROM Teacher GROUP BY Department;
      2. SELECT MAX(Date_of_Join),MIN(Date_of_Join) FROM Teacher;
      3. SELECT Name, Salary, T.Department, Place FROM Teacher T, Placement P WHERE T.Department = P.Department AND Salary>20000;
      4. SELECT Name, Place FROM Teacher T, Placement P WHERE Gender =’F’ AND T.Department=P.Department;
    2. Write the command to view all tables in a database.
  2. Write a function INDEX_LIST(L), where L is the list of elements passed as argument to the function. The function returns another list named ‘indexList’ that stores the indices of all Non-Zero Elements of L.
    For example:
    If L contains [12, 4, 0, 11, 0, 56] The indexList will have – [0, 1, 3, 5]
  3. A list contains following record of a customer:
    [Customer_name, Phone_number, City] Write the following user defined functions to perform given operations on the stack named ‘status’:

    1. Push_element() – To Push an object containing name and Phone number of customers who live in Goa to the stack
    2. Pop_element() – To Pop the objects from the stack and display them. Also, display “Stack Empty” when there are no elements in the stack.

    For example:
    If the lists of customer details are:
    [“Gurdas”, “99999999999”,”Goa”] [“Julee”, “8888888888”,”Mumbai”] [“Murugan”,”77777777777”,”Cochin”] [“Ashmit”, “1010101010”,”Goa”] The stack should contain
    [“Ashmit”,”1010101010”] [“Gurdas”,”9999999999”] The output should be:
    [“Ashmit”,”1010101010”] [“Gurdas”,”9999999999”] Stack Empty

    OR

    Write a function in Python, Push(SItem) where, SItem is a dictionary containing the details of stationary items- {Sname:price}.
    The function should push the names of those items in the stack who have price greater than 75. Also display the count of elements pushed into the stack.
    For example:
    If the dictionary contains the following data:
    Ditem = {“Pen”:106,”Pencil”:59,”Notebook”:80,”Eraser”:25}
    The stack should contain
    Notebook
    Pen
    The output should be:
    The count of elements in the stack is 2

CBSE class 12 Computer Science Sample Paper SECTION D

  1. Make In India Corporation, an Uttarakhand-based IT training company, is planning to set up training centres in various cities in next 2 years. Their first campus is coming up in Kashipur district. At Kashipur campus, they are planning to have 3 different blocks for App development, Web designing and Movie editing. Each block has number of computers, which are required to be connected in a network for communication, data and resource sharing. As a network consultant of this company, you have to suggest the best network-related solutions for them for issues/problems raised in question nos. (i) to (v), keeping in mind the distances between various blocks/locations and other given parameters.

    Distance between various blocks/locations:

    Block Distance
    App development to Web designing28 m
    App development to Movie editing55 m
    Web designing to Movie editing32 m
    Kashipur Campus to Mussoorie Campus232 km

    Number of Computers

    BlockNumber of computers
    App development75
    Web designing50
    Movie editing80
    1. Suggest the most appropriate block/location to house the SERVER in the Kashipur campus (out of the 3 blocks) to get the best and effective connectivity. Justify your answer.
    2. Suggest a device/software to be installed in the Kashipur Campus to take care of data security.
    3. Suggest the best wired medium and draw the cable layout (Block to Block) to economically connect various blocks within the Kashipur Campus.
    4. Suggest the placement of the following devices with appropriate reasons:
      1. Switch / Hub
      2. Repeater
    5. Suggest a protocol that shall be needed to provide Video Conferencing solution between Kashipur Campus and Mussoorie Campus.
    1. Write the output of the code given below:p=5
      def sum(q, r=2):
      global p
      p=r+q**2
      print(p, end= ‘#’)a=10
      b=5
      sum(a, b)
      sum(r=5, q=1)
    2. The code given below inserts the following record in the table Student:
      RollNo – integer
      Name – string
      Clas – integer
      Marks – integer
      Note the following to establish connectivity between Python and MYSQL:

      • Username is root
      • Password is tiger
      • The table exists in a MYSQL database named school.
      • The details (RollNo, Name, Clas and Marks) are to be accepted from the user.

      Write the following missing statements to complete the code:
      Statement 1 – to form the cursor object
      Statement 2 – to execute the query that extracts records of those students whose marks are greater than 75.
      Statement 3- to read the complete result of the query (records whose marks are greater than 75) into the object named data, from the table student in the database.
      import mysql.connector as mysql
      def sql_data():
      con1=mysql.connect (host=”localhost”, user=”root”, password=”tiger”, database=”school”)
      mycursor=________ #Statement 1
      rno=int(input(“Enter Roll Number : : “)) name=input(“Enter name : : “)
      clas=int(input(“Enter class : : “))
      marks=int(input(“Enter Marks : : “))
      querry=”insert into student
      values({},'{}’,{},{})”.format(rno, name, clas, marks) ________ #Statement 2
      ________ # Statement 3
      print(“Data Added successfully”)

  2. OR

    1. Predict the output of the code given below:s=”welcome2cs”
      n = len(s)
      m=””
      for i in range(0, n):
      if (s [i] >= ‘a’ and s [i] <= ‘m’) :
      m = m +s [i] .upper ()
      elif (s [i] >= ‘n’ and s [i] <= ‘z’):
      m = m +s[i-1] elif (s [i].isupper()):
      m = m + s [i] .lower()
      else: m = m + s [i] .lower ()
      print(m)
    2. The code given below reads the following record from the table named student and displays only those records who have marks greater than 75:
      RollNo – integer
      Name – string
      Clas – integer
      Marks – integer
      Note the following to establish connectivity between Python and MYSQL:

      • Username is root
      • Password is tiger
      • The table exists in a MYSQL database named school.

      Write the following missing statements to complete the code:
      Statement 1 – to form the cursor object
      Statement 2 – to execute the query that extracts records of those students whose marks are greater than 75.
      Statement 3- to read the complete result of the query (records whose marks are greater than 75) into the object named data, from the table student in the database.
      import mysql.connector as mysql
      def sql_data():
      con1=mysql.connect(host=”localhost”,user=”root”, password=”tiger”, database=”school”)
      mycursor=________ #Statement 1
      print(“Students with marks greater than 75 are : “)
      ________  #Statement 2
      data=________ #Statement 3
      for i in data:
      print(i)
      print()

  3. What is the advantage of using a csv file for permanent storage? Write a Program in Python that defines and calls the following user defined functions:
    1. ADD() – To accept and add data of an employee to a CSV file ‘record.csv’. Each record consists of a list with field elements as empid, name and mobile to store employee id, employee name and employee salary respectively.
    2. COUNTR() – To count the number of records present in the CSV file named ‘record.csv’.

    OR

    Give any one point of difference between a binary file and a csv file. Write a Program in Python that defines and calls the following user defined functions:

    1. add() – To accept and add data of an employee to a CSV file ‘furdata.csv’. Each record consists of a list with field elements as fid, fname and fprice to store furniture id, furniture name and furniture price respectively.
    2. search()- To display the records of the furniture whose price is more than 10000.

      CBSE class 12 Computer Science Sample Paper SECTION E

  4. Navdeep creates a table RESULT with a set of records to maintain the marks secured by students in Sem 1, Sem2, Sem3 and their division. After creation of the table, he has entered data of 7 students in the table.
    ROLL_NOSNAMESEM1SEM2SEM3DIVISION
    101KARAN366410402I
    102NAMAN300350325I
    103ISHA400410415I
    104RENU350357415I
    105ARPIT10075178IV
    106SABINA100205217II
    107NEELAM470450471I

    Based on the data given above answer the following questions:

    1. Identify the most appropriate column, which can be considered as Primary key.
    2. If two columns are added and 2 rows are deleted from the table result, what will be the new degree and cardinality of the above table?
    3. Write the statements to:
      1. Insert the following record into the table Roll No- 108, Name- Aadit, Sem1- 470, Sem2-444, Sem3- 475, Div –
      2. Increase the SEM2 marks of the students by 3% whose name begins with ‘N’.

        OR (Option for part iii only)

      Write the statements to:

      1. Delete the record of students securing IV division.
      2. Add a column REMARKS in the table with datatype as varchar with 50 characters
  5. Aman is a Python programmer. He has written a code and created a binary file record.dat with employeeid, ename and salary. The file contains 10 records.
    He now has to update a record based on the employee id entered by the user and update the salary. The updated record is then to be written in the file temp.dat. The records which are not to be updated also have to be written to the file temp.dat. If the employee id is not found, an appropriate message should to be displayed.
    As a Python expert, help him to complete the following code based on the requirement given above:
    import ________ #Statement 1
    def update_data():
    rec={}
    fin=open(“record.dat”,”rb”)
    fout=open(“________”) #Statement 2
    found=False
    eid=int(input(“Enter employee id to update their salary :: “))
    while True:
    try:
    rec=________ #Statement 3
    if rec [“Employee id”]==eid:
    found=True
    rec[“Salary”]=int(input(“Enter new salary : : “))
    pickle.________ #Statement 4
    else:
    pickle.dump(rec, fout)
    except:
    break
    if found==True:
    print(“The salary of employee id “,eid,” has been updated.”)
    else:
    print(“No employee with such id is not found”)
    fin.close()
    fout.close()

    1. Which module should be imported in the program? (Statement 1)
    2. Write the correct statement required to open a temporary file named temp.dat. (Statement 2)
    3. Which statement should Aman fill in Statement 3 to read the data from the binary file, record.dat and in Statement 4 to write the updated data in the file, temp.dat?

These are questions only. To view and download complete question paper with solution install myCBSEguide App from google play store or login to our student dashboard.

Download myCBSEguide App

CBSE Sample Papers for Class 12

To download sample paper for class 12 Physics, Chemistry, Biology, History, Political Science, Economics, Geography, Computer Science, Home Science, Accountancy, Business Studies and Home Science; do check myCBSEguide app or website. myCBSEguide provides sample papers with solution, test papers for chapter-wise practice, NCERT solutions, NCERT Exemplar solutions, quick revision notes for ready reference, CBSE guess papers and CBSE important question papers. Sample Paper all are made available through the best app for CBSE students and myCBSEguide website.

myCBSEguide App

Test Generator

Create question paper PDF and online tests with your own name & logo in minutes.

Create Now
myCBSEguide App

myCBSEguide

Question Bank, Mock Tests, Exam Papers, NCERT Solutions, Sample Papers, Notes

Install Now

Leave a Comment