myCBSEguide App
Download the app to get CBSE Sample Papers 2024-25, NCERT Solutions (Revised), Most Important Questions, Previous Year Question Bank, Mock Tests, and Detailed Notes.
Install NowCBSE Sample Papers Class 12 Computer Science 2025
We recommend students to check out the Class 12 Computer Science model question papers 2024-25 on the myCBSEguide app for thorough exam preparation. CBSE Sample Papers for Class 12 Computer Science 2025 are now available for free download on both the official CBSE website and the myCBSEguide app. These sample papers provide a clear insight into the exam pattern and structure. The Class 12 Computer Science Sample Papers 2025 mainly feature subjective questions, with only 16 MCQs and 2 Assertion-Reason (ARQs) questions. For teachers, the Examin8 App is a perfect tool to create customized test papers with your name and logo. CBSE Sample Papers Class 12 Computer Science 2025 are now available on the myCBSEguide Website, offering students the opportunity to practice real exam questions in PDF format.
Sample Papers of Computer Science class 12 – free PDF Download
CBSE Sample Papers for Class 12 Computer Science 2025 are now available for free download in PDF format on the myCBSEguide app and website. These sample papers are designed to help students get a clear understanding of the CBSE exam pattern and prepare efficiently for their Class 12 Computer Science board exams. Along with the sample papers, CBSE marking scheme and blueprint are also provided, helping students learn how to approach the exam effectively. For effective revision, download the CBSE Sample Papers Class 12 Computer Science 2025 to understand the exam format and marking scheme before the board exams.
Sample Papers for Class 12 Computer Science 2025 Download as PDF
Sample paper 2025 class 12 Computer Science
myCBSEguide offers CBSE Class 12 Board Sample Papers for Computer Science 2025 with solutions available for free download in PDF format. In addition to Computer Science, myCBSEguide provides sample papers for all major CBSE Class 12 subjects, making it a one-stop platform for comprehensive exam preparation. These Class 12 Computer Science sample papers are based on the most recent syllabus and are designed to help students understand the question format, time management, and marking scheme. You can easily access these sample papers with solutions for the 2025 academic session through the myCBSEguide app or by logging into your Student Dashboard. The platform provides sample papers for Class 12 Computer Science as well as other subjects for the year 2025.
Key Features of CBSE Class 12 Computer Science Sample Papers 2025:
- Free PDF downloads with detailed solutions.
- Updated sample papers based on the CBSE blueprint for 2025.
- Available for all major subjects, including Computer Science.
- Student Dashboard access for easy downloading and tracking progress.
CBSE Sample Papers Class 12 Computer Science 2025
Class 12 – Computer Science
Sample Paper – 01 (2024-25)
Maximum Marks: 70
Time Allowed: : 3 hours
General Instructions:
- This question paper contains 37 questions.
- All questions are compulsory. However, internal choices have been provided in some questions. Attempt only one of the choices in such questions.
- The paper is divided into 5 Sections- A, B, C, D and E.
- Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
- Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
- Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
- Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
- Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
- All programming questions are to be answered using Python Language only.
- In case of MCQ, text of the correct answer should also be written.
- Section A
- State true or false:
In a nested loop, a break statement terminates all the nested loops in one go.a) Trueb) False - A relational database consists of a collection of:a) Fieldsb) Keysc) Recordsd) Tables
- fetchall() method fetches all rows in a result set and returns a:a) Tuple of stringsb) Tuple of listsc) List of tuplesd) List of strings
- What is the output of the below program?
def printMax(a, b):
if a > b:
print(a, ‘is maximum’)
elif a = b:
print(a, ‘is equal to’, b)
else:
print(b, ‘is maximum’)
printMax(3, 4)a) 3 is maximumb) 4c) 4 is maximumd) 3 - What is the output of the following?
d = {0, 1, 2}
for x in d.values() :
print (x) - Which type of transmission media is the least expensive to manufacture?a) Twisted pair cableb) CAT cablec) Coaxiald) Fibre optic
- Which character is used to create a new file in csv?a) xb) rc) r+d) w
- l1 = [1,2,3,4,5] l1.append([5,6,[7,8,[9,10])
What will be the final length of l1?a) 10b) 5c) 8d) Error - The HAVING clause does which of the following?a) Acts like a WHERE clause but is used for columns rather than groups.b) Acts like a WHERE clause but is used for rows rather than columns.c) Acts like a WHERE clause but is used for groups rather than rows.d) Acts EXACTLY like a WHERE clause.
- Write a line of code that writes “Hello world!” to a file opened with file object my file.
- State true or false:
The default values for parameters are considered only if no value is provided for that parameter in the function call statement.a) Trueb) False - When a stack, implemented as an array/list of fixed size, is full and no new element can be accommodated, it is called an ________.a) OVERFLOWb) NOFLOWc) EXTRAFLOWd) UNDERFLOW
- In SQL, write the name of the aggregate function which will display the cardinality of a table.
- A ________ is a network spread across states, countries or whole world.a) PANb) LANc) WANd) MAN
- What is the output of following code ?
def f():
x = (2856 / 156) % 89
print(x++)
x* = 34
f()a) 19b) 18c) 646d) Error - Which of the following is not a sequential datatype in Python?a) Listb) Dictionaryc) Tupled) String
- Which transmission media is capable of having a much higher bandwidth (data capacity)?a) Untwisted cableb) Twisted pair cablec) Fibre opticd) Coaxial
- Which part of TCP/IP is responsible for dividing a file or message into very small parts, at the source computer?a) ISPb) Both TCP and IPc) TCPd) IP
- Assertion (A): The tuple items cannot be deleted by using the del keyword.
Reason (R): To delete an entire tuple, we can use the del keyword with the tuple name.a) Both A and R are true and R is the correct explanation of A.b) Both A and R are true but R is not the correct explanation of A.c) A is true but R is false.d) A is false but R is true. - Assertion (A): pandas is defined as an open-source library that is built on top of the NumPy library.
Reason (R): pandas provides fast analysis, data cleaning, and preparation of the data for the user.a) Both A and R are true and R is the correct explanation of A.b) Both A and R are true but R is not the correct explanation of A.c) A is true but R is false.d) A is false but R is true. - Assertion (A): If you try to change the value of a frozenset item this will cause an error.
Reason (R): The frozenset() function returns an changeable frozenset objecta) Both A and R are true and R is the correct explanation of A.b) Both A and R are true but R is not the correct explanation of A.c) A is true but R is false.d) A is false but R is true.
To practice more questions & prepare well for exams, download myCBSEguide.com App. It provides complete study material for CBSE, NCERT, JEE (main), NEET-UG and NDA exams. Teachers can use Examin8.com App to create similar papers with their own name and logo. The Class 12 Computer Science Sample Papers 2025 available on myCBSEguide are based on the latest syllabus issued by the CBSE board. With questions and solutions in each sample paper, you’ll have everything you need to perform well in the CBSE Class 12 Computer Science exam. - Section B
- Write Python code to create a table location with the following fields
id id of the location bidycode code of the building room type of rooms capacity capacity of the room - Observe the given list and find the answer of questions that follows.
list1 = [23, 45, 63, ‘Hello’, 20 ‘World’, 15, 18]- list1 [-3]
- list[3]
OR
Draw a flow chart to find the factorial of any number.
- The table Company of database connect contains the following records
Name Dept Salary ABC DBA 35000 XYZ Analyst 42000 ABC1 DBA 40000 What will be the output of following code?
import mysql.connector con = mysql.connector.connect(host = "localhost", user = "system",passwd = "hello",database = "connect") cur = con.cursor() cur.execute("select Name, Salary from Company") display = cur.fetchone() print(display)
- Predict the output.
a, b = 10, 15 x = 20 y = 25 a = x + y - b x = a + b - y + 10 z = y + b * 3 + a x = 50 a = x + y + z print("a :", a) print("b :", b) print("x :", x) print("y :", y) print("z :", z)
OR
What is the length of the tuple shown below?
t = ((((‘a’, 1), ‘b’, ‘c’), ‘d’, 2), ‘e’, 3) - Consider a binary file Employee.dat containing details such as empno:ename:salary (separator ‘:’). Write a Python function to display details of those employees who are earning between 20000 and 40000. (Both values inclusive)OR Write a function count_Dwords () in Python to count the words ending with a digit in a text file “Details.txt”.
Example:
If the file content is as follows:
On seat2 VIP1 will sit and
On seat1 VVIP2 will be sitting
Output will be:
Number of words ending with a digit are 4 - Explain the use of a default parameter in a Python function with the help of a suitable example.
- Explain the two types of duplex communication.
- Section C
- Write a method in Python to find and display the prime number between 2 to n. Pass n as an argument to the method.OR Write functions in Python for InsertQ(Names) and RemoveQ(Names) for performing insertion and removal operations with a queue of list which contains names of students. The function must check for Empty Queue.
- Write the output of SQL queries (a) to (d) based on the table VACCINATION_DATA given below:TABLE: VACCINATION_DATA
VID Name Age Dose1 Dose2 City 101 Jenny 27 2021-12-25 2022-01-31 Delhi 102 Harjot 55 2021-07-14 2021-10-14 Mumbai 103 Srikanth 43 2021-04-18 2021-07-20 Delhi 104 Gazala 75 2021-07-31 NULL Kolkata 105 Shiksha 32 2022-01-01 NULL Mumbai - SELECT Name, Age FROM VACCINATION_DATA
WHERE DOSE2 IS NOT NULL AND Age >40; - SELECT City, COUNT(*) FROM VACCINATION_DATA GROUP BY City;
- SELECT DISTINCT CIEY EROM VACCINATION_DATA;
- SELECT MAX (Dose1), MIN (Dose2) FROM VACCINATION_DATA;
OR
What is the purpose of using MySQL?
- SELECT Name, Age FROM VACCINATION_DATA
- What is the difference between a local variable and a global variable? Also, give a suitable Python code to illustrate both.OR Write definition of a method OddSum(NUMBERS) to add those values in the list of NUMBERS, which are not even.
- Section D
- Write a program to implement a stack for these book details (book no., book name). That is, now each item node of the stack contains two types of information – a book no. and its name. Just implement Push and display operations.OR A line of text is read from the input terminal into a stack. Write a program to output the string in the reverse order, each character appearing twice.
(ie.g., the string a b c d e should be changed to ee dd cc bb aa) - A binary file “PATIENTS.dat” has structure (PID, NAME, DISEASE).
Write the definition of a function countrec() in Python that would read contents of the file “PATIENTS.dat” and display the details of those patients who have the DISEASE as ‘COVID-19’. The function should also display the total number of such patients whose DISEASE is ‘COVID-19’. - Study the following tables DOCTOR and SALARY and write SQL commands for the questions (i) to (v).TABLE: DOCTOR
ID NAME DEPT SEX EXPERIENCE 101 John ENT M 12 104 Smith ORTHOPEDIC M 5 107 George CARDIOLOGY M 10 114 Lara SKIN F 3 109 K George MEDICINE F 9 105 Johnson ORTHOPEDIC M 10 117 Lucy ENT F 3 111 Bill MEDICINE F 12 130 Morphy ORTHOPEDIC M 15 TABLE: SALARY
ID BASIC ALLOWANCE CONSULTATION 101 12000 1000 300 104 23000 2300 500 107 32000 4000 500 114 12000 5200 100 109 42000 1700 200 105 18900 1690 300 130 21700 2600 300 - Display NAME of all doctors who are in MEDICINE department having more than 10 yrs experience from the table DOCTOR.
- Display the average salary of all doctors working in ENT department using the tables DOCTOR and SALARY.SALARY = BASIC + ALLOWANCE.
- Display the minimum ALLOWANCE of female doctors.
- Display the highest consultation fee among all male doctors.
- To display the detail of doctor who have experience more than 12 years.
OR
Consider the following tables PRODUCT and CLIENT. Write SQL commands for the following statements.Table: PRODUCT
P_ID ProductName Manufacturer Price TP01 Talcum Powder LAK 40 FW05 Face Wash ABC 45 BS01 Bath Soap ABC 55 SH06 Shampoo XYZ 120 FW12 Face Wash XYZ 95 Table: CLIENT
C_ID ClientName City P_ID 01 Cosmetic Shop Delhi FW05 06 Total Health Mumbai BS01 12 Live Life Delhi SH06 15 Pretty Woman Delhi FW12 16 Dreams Banglore TP01 - To display the details of those Clients whose City is Delhi.
- To display the details of Products whose Price is in the range of 50 to 100 (Both values included).
- To display the ClientName, City from table Client, and ProductName and Price from table Product, with their corresponding matching P_ID.
- To increase the Price of all Products by 10.
- Write a program that inputs the main string and then creates an encrypted string by embedding a short symbol-based string after each character. The program should also be able to produce the decrypted string from an encrypted string.
- Section E
- The Freshminds University of India is starting its first campus in Ana Nagar of South India with its center admission office in Kolkata. The university has 3 major blocks comprising of Office Block, Science Block and Commerce Block in the 5 km area Campus.
As a network expert, you need to suggest the network plan as per (i) to (iv) to the authorities keeping in mind the distance and other given parameters.
Expected Wire distances between various locations:Office Block to Science Block 90 m Office Block to Commerce Block 80 m Science Block to Commerce Block 15 m Kolkata Admission office to Ana Nagar Campus 2450 km Expected number of Computers to be installed at various locations in the University are as follows:
Office Block 10 Science Block 140 Commerce Block 30 Kolkata Admission office 8 - What type of server should be installed in university?
- Dedicated
- Non-dedicated
- Suggest the most suitable place (i.e., block) to house the server of this university with a suitable reason.
- Suggest an efficient device from the following to be installed in each of the blocks to connect all the computers:
- MODEM
- SWITCH
- GATEWAY
- Suggest the most suitable (very high speed) service to provide data connectivity between Admission Office located in Kolkata and the campus located in Ana Nagar from the following options:
- Telephone line
- Fixed-Line Dial-up connection
- Co-axial Cable Network
- GSM
- Leased line
- Satellite Connection
- What type of server should be installed in university?
- Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which are based on the tables:TABLE: BOOK
Code BNAME TYPE F101 The Priest Fiction L102 German easy Literature C101 Tarzan in the lost world Comic F102 Untold story Fiction C102 War heroes Comic TABLE: MEMBER
MNO MNAME CODE ISSUEDATE M101 RAGHAV SINHA LI 02 2016-10-13 M103 S ARTHAKJ OHN FI 02 2017-02-23 M102 ANISHA KHAN C101 2016-06-12 - To display all details from table MEMBER in descending order of ISSUEDATE.
- To display the BNO and BNAME of all Fiction Type books from the table Book.
- To display the TYPE and number of books in each TYPE from the table BOOK.
- To display all MNAME and ISSUEDATE of those members from table MEMBER who have books issued (i.e., ISSUEDATE) in the year 2017.
- SELECT MAX (ISSUEDATE) FROM MEMBER
- SELECT DISTINCT TYPE FROM BOOK
- SELECT A.CODE, BNAME, MNO. MNAME FROM BOOK A. MEMBER B WHERE A.CODE= B.CODE
- SELECT BNAME FROM BOOK WHERE TYPE NOT IN (“FICTION”, “COMIC”)
OR
Consider the following tables CABHUB and CUSTOMER and answer the following parts of this question :
Table: CABHUBVcode VehicleName Make Color Capacity Charges 100 Innova Toyota WHITE 7 15 102 SX4 Suzuki BLUE 4 14 104 C Class Mercedes RED 4 35 105 A-Star Suzuki WHITE 3 14 108 Indigo Tata SILVER 3 12 Table: CUSTOMER
CCode CName Vcode 1 Hemant Sahu 101 2 Raj Lai 108 3 Feroza Shah 105 4 Ketan Dhal 104 Give the output of the following SQL queries :
- SELECT COUNT (DISTINCT Make) FROM CABHUB ;
- SELECT MAX(Charges), MIN(Charges) FROM CABHUB ;
- SELECT COUNT(*), Make FROM CABHUB ;
- SELECT VehicleName FROM CABHUB WHERE Capacity = 4;
For top-notch exam preparation, download the myCBSEguide App today. The app offers a wide range of study materials for CBSE, NCERT, JEE (Main), NEET-UG, and NDA exams. Whether you’re a student or a teacher, myCBSEguide Website equips you with everything you need to succeed—sample papers, practice questions, study notes, and revision materials tailored to your syllabus.Students can enhance their exam readiness with customized study plans and timely reminders, while teachers can utilize the Examin8 App and Examin8 Website to create personalized exam papers. This feature allows educators to generate test papers with their own name and logo, making it an invaluable tool for crafting customized assignments and assessments to improve classroom learning.
Class 12 – Computer Science
Sample Paper – 01 (2024-25)
Solution
Section A
- (b) False
Explanation: False - (d) Tables
Explanation: A relational database consists of a collection of tables that store interrelated data. - (c) List of tuples
Explanation: List of tuples - (c) 4 is maximum
Explanation: Here, we define a function called printMax that uses two parameters called a and b. We find out the greater number using a simple if..else statement and then print the bigger number.The above code will produce error as the statement above is not correct form of dictionary, which has keys and values. - (a) Twisted pair cable
Explanation: Twisted pair cable is the least expensive transmission media. - (a) x
Explanation: x - (b) 5
Explanation: A list is getting added in list l1 which will be counted as one item for the list. - (c) Acts like a WHERE clause but is used for groups rather than rows.
Explanation: Acts like a WHERE clause but is used for groups rather than rows.HAVING is used to filter values after they have been groups. - myfile.write(“Hello world!”)
File object is myfile, and write() function writes string “Hello World!” into the file. - (a) True
Explanation: True - (a) OVERFLOW
Explanation: When a stack, implemented as an array/list of fixed size, is full and no new element can be accommodated, it is called an OVERFLOW. - The aggregate function that can display the cardinality (number of rows) of a table in SQL is COUNT.
- (c) WAN
Explanation: WAN spans a large geographical area, often a country or a continent and uses various commercial and private communication lines to connect computers. - (d) Error
Explanation: ++ is not defined as an increment operator in python. - (b) Dictionary
Explanation: Dictionary - (c) Fibre optic
Explanation: The transmission capacity of optical fibre cable is 26,000 times higher than that of twisted pair cable. - (c) TCP
Explanation: TCP - (b) Both A and R are true but R is not the correct explanation of A.
Explanation: The tuple items cannot be deleted individually by using the del keyword as tuple is immutable. To delete an entire tuple, we can use the del keyword with the tuple name. - (b) Both A and R are true but R is not the correct explanation of A.
Explanation: pandas is defined as an open-source library that is built on top of the NumPy library and it provides fast analysis, data cleaning, and preparation of the data for the user. - (c) A is true but R is false.
Explanation: The frozenset() function returns an unchangeable/immutable version of a set object. The elements of set can be changed at any time but the elements of frozenset remains same. If you try to change the value of a frozenset item, it will cause an error.For effective exam preparation, download the myCBSEguide App today. It offers complete study material for CBSE, NCERT, JEE (Main), NEET-UG, and NDA exams. The app provides a wide range of resources including sample papers, practice questions, study notes, and revision tools, all designed to help you ace your exams.Whether you’re preparing for CBSE board exams or competitive tests like JEE, NEET, or NDA, the myCBSEguide Website has everything you need to study smarter and perform better.In addition, Examin8 App and Examin8 Website allows teachers to easily create customized test papers with their name and logo, making it an excellent tool for generating personalized assessments and assignments.
- (b) False
- Section B
- import MySQLdb
db = MySQLdb.connect(“localhost”, “Admin”, “Ad123”, “HMD”)
cursor= db.cursor()
cursor.execute(“DROP TABLE IF EXISTS Location”)
sql=” ” “Create Table location (id Numeric(5) PRIMARY KEY, bidycode varchar(10) Not Null ,
room varchar(6) Not Null , Capacity Numeric(5) Not Null)” ” ”
cursor.execute(sql)
db.close()- ‘World’
- ‘Hello’
- OR
- (‘ABC’, 35000)
- Output
a : 175
b : 15
x : 50
y : 25
z : 100OR The length of this tuple is 3 because there are just three elements in the given tuple. Because a careful look at the given tuple yields that tuple t is made up of:
t1 = “a”, 1
t2 = t1, “b”, “c”
t3 = t2, “d”, 2
t = (t3, “e”, 3) def Readfile(): i=open("Employee.dat", "rb+") x=i.readline() while(x): l=x.split(':') if (20000>=float(1[2])<=40000): print(x) x=i.readline()
OR
def count_Dwords(): with open ("Details.txt", 'r') as F: # ignore 'r' S=F.read() Wlist = S.split() count = 0 for w in wlist: if w [-1].isdigit(): count+=1 print ("Number of words ending with a digit are", count)
OR
def count_Dwords(): count=0 myfile=open("Details.txt") S=myfile.read() Wlist=S.split() for W in Wlist: if i[-1] in "0123456789": count=count+1 myfile.close() print("Number of words ending with a digit are",count)
- In Python, a default parameter is defined with a fallback value as a default argument. Such parameters are optional during a function call. If no argument is provided, the default value is used, and if an argument is provided, it will overwrite the default value. greet(“Ankit”, “How do you do?”)
- There are mainly two types of duplex communication:
- Full duplex: In this type of transmission, two bitstreams can be simultaneously transmitted over the links at the same time, one going in each direction, i.e., sending as well as receiving the data. For example, in a telephone conversation, two people communicate, and both are free to speak and listen at the same time.
- Half-duplex: In this type of transmission, data can flow in only one direction at a time i.e., either sending or receiving data at a time. For example, in walkie-talkies, the speakers at both ends can speak, but they have to speak one by one. They cannot speak simultaneously.
- Section C
- def prime(n) :
for num in range (2, n) :
is_prime = 1
for i in range (2, num):
if num % i == 0:
is_prime = 0
if is_prime == 1:
print (num)ORdef InsertQ(Names): Name=raw_input("enter Name to be inserted: ") Names.append(Name) def DeleteQ(Names): if (Names==[]): print "Queue empty" else: print "Deleted Player’s Name is: ",Names[0] del(Names[0])
- SELECT Name, Age FROM VACCINATION_DATA WHERE DOSE2 IS NOT NULL AND Age > 40;
Name Age Harjot 55 Srikanth 43 - SELECT City, COUNT(*) FROM VACCINATION_DATA GROUP BY City;
City COUNT(*) Delhi 2 Mumbai 2 Kolkata 1 - SELECT DISTINCT CITY FROM VACCINATION_DATA;
CITY Delhi Mumbai Kolkata - SELECT MAX(Dose1), MIN(Dose2) FROM VACCINATION_DATA;
MAX(Dose1) MIN(Dose2) 2022-01-01 2021-07-20
- SELECT Name, Age FROM VACCINATION_DATA WHERE DOSE2 IS NOT NULL AND Age > 40;
- OR MySQL is a free, open-source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). In a MySQL database, information is stored in Tables. A single MySQL database can contain many tables at once and store thousands of individual records.
- The differences between a local variable and a global variable are as given below :
Local Variable Global Variable 1. It is a variable which is declared within a function or within a block 1. It is a variable which is declared outside all the functions 2. It is accessible only within a function/block in which it is declared 2. It is accessible throughout the program 3.Local variables are created when the function has started execution and are lost when the function terminates. 3.Global variable is created as execution starts and is lost when the program ends. For example, in the following code, x, xCubed are global variables and n and cn are local variables.
def cube(n):
cn = n * n * n
return cn
x = 10
xCubed = cube(x)
print(x, “cubed is”, xCubed)ORdef OddSum(NUMBERS) :
odd_sum = 0
for num in range (len(NUMBERS)):
if (NUMBERS[num] % 2 != 0:
odd_sum = odd_sum + NUMBERS [num] print odd_sum - Section D
- ” ” ”
Stack: implemented as a list
top: integer having a position of a topmost element in Stack
” ” ”
def cls( ):
print(“\n”* 100)
def is Empty(stk) :
if stk== [ ] :
return True
else :
return False
def Push(stk, item) :
stk.append(item)
top = len(stk) – 1
def Display(stk) :
if isEmpty(stk) :
print (“Stack empty”)
else :
top = len(stk) – 1
print(stk[top], “<-top”)
for a in range(top-1, -1, -1 ) :
print(stk[a])
# __main__
Stack = [] # initially stack is empty
top = None
while True :
cls()
print (“STACK OPERATIONS”)
print(“1. Push operation”)
print(“2. Display stack”)
print(“3. Exit”)
ch = int(input(“Enter your choice (1-5) :”))
if ch == 1 :
bno = int(input(“Enter Book no. to be inserted :”))
bname = input (“Enter Book name to be inserted :”)
item = [bno, bname] # creating a list from the input items.
PushfStack, item)
input()
elif ch == 2 :
Display(Stack)
input( )
elif ch == 3 :
break
else :
print(“Invalid choice!”)
input()OR MAX_SIZE = 1000
stack = [0 for i in range(MAX_SIZE)] top = 0
def isEmpty ( ):
global top
return top == 0
def push(x):
global stack,top
if top >= MAX_SIZE:
return
stack[top]= x
top += 1
def pop( ):
global stack,top
if isEmpty( ):
return
else:
top -= 1
return stack[top] string = input( ).split()
for i in string:
push(i)
while not isEmpty( ):
x = pop( )
print (x + x, end = ‘ ‘) def countrec(): try: # Open the binary file in read mode with open("PATIENTS.dat", "rb") as file: covid_patients = [] # List to store COVID-19 patients total_covid_patients = 0 while True: record = file.readline().decode().strip() if not record: break PID, NAME, DISEASE = record.split(",") if DISEASE == "COVID-19": covid_patients.append((PID, NAME)) total_covid_patients += 1 # Display details of COVID-19 patients print("Details of COVID-19 patients:") for pid, name in covid_patients: print(f"PID: {pid}, NAME: {name}") print(f"Total COVID-19 patients: {total_covid_patients}") except FileNotFoundError: print("File 'PATIENTS.dat' not found.") # Call the function countrec()
- SELECT NAME FROM DOCTOR WHERE DEPT=’MEDICINE’ AND EXPERIENCE > 10;
- SELECT AVG(BASIC + ALLOWANCE) FROM SALARY WHERE SALARY.ID IN(SELECT ID FROM DOCTOR WHERE DEPT=’ENT’);
- SELECT MIN(ALLOWANCE) FROM SALARY WHERE SALARY.ID IN(SELECT ID FROM DOCTOR WHERE SEX =’F’);
- SELECT MAX(CONSULTATION) FROM SALARY WHERE SALARY.ID IN(SELECT ID FROM DOCTOR WHERE SEX=’M’);
- SELECT * FROM DOCTOR
WHERE EXPERIENCED>12;
- OR
- SELECT * FROM CLIENT
WHERE City = ‘ Delhi ‘ ; - SELECT * FROM PRODUCT
WHERE Price BETWEEN 50 AND 100 ; - SELECT ClientName, City, ProductName, Price
FROM CLIENT, PRODUCT
WHERE CLIENT.P_ID = PRODUCT.P_ID ; - UPDATE PRODUCT
SET Price = Price + 10 ;
- SELECT * FROM CLIENT
- def encrypt(sttr, enkey):
return enkey.join(sttr)
def decrypt(sttr, enkey):
return sttr.split(enkey)
#-main-
mainstring = input(“Enter main string:”)
encryptStr = input(“Enter encyption key:”)
enStr = encrypt(mainString, encryptStr)
deLst = decrypt(enStr, encryptStr)
# deLst is in the form of a list, converting it to string below
deStr=””.join(deLst)
print(“The encrypted string is”, enStr)
print(“String after decryption is:”, deStr)
The sample run of the above program is as shown below:
Enter main string : My main string
Enter encryption key : @$
The encrypted string is m@$y@$ @$m@$a@$i@$n@$ @$s@$t@$r@$i@$n@$g
String after decryption is : My main string - Section E
- The server should be Dedicated server
- The most suitable place to house the server is Science Block as it has the maximum number of computers. Thus, reducing the cabling cost and increase the efficiency of the network.
- SWITCH
- Satellite Connection Or Leased line
- SELECT * FROM MEMBER ORDER BY ISSUEDATE DESC
- SELECT Code, BNAME FROM BOOK WHERE TYPE ‘Fiction’
- SELECT COUNT(*), TYPE FROM BOOK GROUP BY TYPE
- SELECT MNAME, ISSUEDATE FROM MEMBER WHERE ISSUEDATE Like ‘2017 %’
- MAX (ISSUE DATE) 2017-02-23
- DISTINCT (TYPE)
Fiction
Literature
Comic CODE BNAME MNO MNAME L102 German easy M101 RAGHAV SINHA F102 Untold Story M103 SARTHAK JOHN C101 Tarzan in the lost world M102 ANISHA KHAN - BNAME
German easy
- OR
- 4
35 12 - Invalid query
- SX4
C Class
Boost Your Exam Preparation with the myCBSEguide AppFor effective exam preparation, download the myCBSEguide App today. It offers complete study material for CBSE, NCERT, JEE (Main), NEET-UG, and NDA exams. The app provides a wide range of resources, including practice questions, sample papers, study notes, and revision guides—all designed to help students excel in their exams.Whether you’re aiming for top marks in CBSE, preparing for JEE Main, NEET UG, or the NDA exam, the myCBSEguide app and myCBSEguide website has everything you need to study effectively and efficiently.Additionally, Examin8 App and Examin8 Website allows teachers to create customized test papers with their name and logo, making it a valuable tool for generating personalized exams and assignments.
CBSE Sample Papers for Class 12
- Physics
- Chemistry
- Mathematics
- Biology
- English Core
- Business Studies
- Economics
- Accountancy
- Computer Science
- Informatics Practices
- Hindi Core
- Hindi Elective
- History
- Political Science
- Geography
- Home Science
- Physical Education
- Other Subjects
For comprehensive exam preparation, download sample papers for Class 12 in Physics, Chemistry, Biology, History, Political Science, Economics, Geography, Computer Science, Home Science, Accountancy, Business Studies, and more on the myCBSEguide app or myCBSEGuide website. These CBSE Class 12 sample papers come with detailed solutions and are based on the latest syllabus and exam pattern. The Examin8 website and Examin8 app provide a complete exam preparation solution with sample papers, mock tests, and personalized learning plans. Access Class 9 Hindi A Sample Papers 2025 for better exam practice and confidence.
myCBSEguide offers a complete range of study resources to help you excel in your board exams. You can access chapter-wise test papers, NCERT solutions, NCERT Exemplar solutions, and quick revision notes to sharpen your understanding of key concepts. Additionally, you’ll find CBSE guess papers, important question papers, and other essential resources to boost your exam preparation.
Whether you’re preparing for Class 12 Physics, Chemistry, Biology, or any other subject, myCBSEguide provides the best app and website for CBSE students to download and practice sample papers and solve practice questions efficiently.
Why Choose myCBSEguide for Your CBSE Exam Preparation?
1. Comprehensive Study Materials
myCBSEguide offers a wealth of study resources, including sample papers, test papers, chapter-wise practice papers, NCERT solutions, and NCERT Exemplar solutions. These materials cover the entire CBSE syllabus, ensuring that students have everything they need to prepare effectively for their exams.
2. Free Sample Papers & Solutions
You can download free sample papers for Class 9 and 10 across all subjects like Science, Mathematics, Social Science, English, and Hindi. Each paper comes with detailed solutions and a marking scheme, helping you understand how to approach different question types.
Test Generator
Create question paper PDF and online tests with your own name & logo in minutes.
Create NowmyCBSEguide
Question Bank, Mock Tests, Exam Papers, NCERT Solutions, Sample Papers, Notes
Install Now
https://mycbseguide.com/blog/category/cbse/cbse-class-12/computer-science-cbse-class-12/page/2/
Read Moree >>>>> DBMS MCQS <<<<<